SugarCRM Account REST API Contacts

In SugarCRM 6.0.0, I need to create a relationship between an account and a contact through the REST web services API.

I tried these methods in both directions (Account → Contact, Contact → Account) to no avail:

$method = 'set_relationship'; $params = array( 'module_name' => 'Accounts', 'module_id' => $accountId, 'link_field_name' => 'accounts_contacts', 'related_ids' => array($userId) ); $method = 'set_entry'; $params = array( 'module_name' => 'Contacts', 'name_value_list' => array( array('name' => 'id', 'value' => $userId), array('name' => 'accounts_contacts', 'value' => $accountId), ), ); 

Numerous search queries give me only these SOAP methods or solutions. Anyone who can point me in the right direction?

+4
source share
1 answer

This line is about

 'link_field_name' => 'accounts_contacts', 

it should be

 'link_field_name' => 'contacts', 

because the name of the link field is "contacts" (the name of the relationship is "account_contacts").

+7
source

Source: https://habr.com/ru/post/1386537/


All Articles