AnsweredAssumed Answered

How can I auto fill a relationship based on a parent module on Pop up and quick create?

Question asked by tanphat911 tanphat911 on Apr 10, 2014
Latest reply on Apr 11, 2014 by tanphat911 tanphat911
Hi everyone i can pass data from parent module to child module with "related field" on quick create but i have no ideal to do with "relationship" ( many to one ) on Pop Up and Quick Create . Anyone have experience with this?

I using sugar CRM 6.5 CE

Here i the code i use to pass data from parent to child module on quick create view.Edit on 
include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateAccountNameButton.php.





if(strtolower($defines['child_module_name']) =='scp_contracts') {
    if(strtolower($defines['parent_bean_name']) == 'scp_client' ){            
     if(isset($defines['focus']->id))$additionalFormFields['company_id_c'] = $defines['focus']->id;
     if(isset($defines['focus']->name))$additionalFormFields['company'] = $defines['focus']->name;
        }            
        }

Outcomes