Create an Email record thru Web Services

sugarcrmdevelopers —  January 2, 2013 — 6 Comments

We had a question come in internally from a partner of ours trying to archive an email into Sugar via Web Services. The Emails modules is a bit different as there are two tables that manage the email, but that is abstracted away at the bean level. See the code example below…

This will create the archived Email record, associating it with the ‘<<RelatedModuleRecordId>>’ in the ‘<<RelatedModuleName>>’ module.

6 responses to Create an Email record thru Web Services

  1. 

    Hello John,

    I did it like you said, but I’m facing an issue. When I go to see the email, it seems fine, the from, to, cc and bcc are filled. But if I edit the email, their value disappear.

    From what I can understand in the php code of the email module, in the function saveEmailAddresses it link each email that are in to, cc, bcc to an object in the module EmailAddresses. Could it be the reason ?
    Could we setup this link using set_relationships ?

    If we need to create all the EmailAddresses objects, is there is a way to batch update using the REST api, so I can create all the EmailAddresses object needed in 1 call ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s