Add Record To Relationship table – SugarCRM / SuiteCRM

Here there is one to many relation ship between Target(Prospect) to Lead
And the relation is ‘prospects_leads_1’
So we can add relationship table entry using following code.

$object = BeanFactory::getBean(‘<module_name>’, $bean->id);
$object->load_relationship(‘<relationship_module_name>’);
$object->prospects_leads_1->add($bean-><module_id>);

Note :

1. Here, <module_name> means the module name you see in the URL, for example, Contacts, Leads, Accounts, etc.
2. <relationship_module_name> means the relationship module name , for example, Contacts, Leads, Accounts, etc.
3. <module_id> means id of module.

Hope you find this blog post helpful.

Feel free to add comments and queries, that helps us to improve the quality of posts.

You can contact us at info@infotechbuddies.com

Thank you.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *