Came across this post on the forums recently…
I am trying to add multiple email addresses in contacts module using web services.
Its working upto three email addresses after that 4th one is not added but its updating third one only.
I am using following code in a loop
‘session’ => $result[‘id’],
‘module_name’ => ‘Contacts’,
‘name_value_list’ => Array(
array(‘name’ => ‘id’, ‘value’ => $crmid),
array(‘name’ => ‘email’.$ind1, ‘value’ => $email[‘email’]),
Please any body give me some idea , why more than three emails are not added.
This is one of the more tricky parts of our web services, since on the data side emails are stored indepedently of the actual records in another related table. Because of this, if you need to add more than two email addresses for a record, you need to add all the additional email addresses directly to the EmailAddresses module and then do a relationship between them. See the below code snippet for a guide on how…
Please note this only works in Sugar 6.1.2 and later, as a bug was fixed in that release in regards to the creating of new EmailAddress record directly from web services.