mattkol / SugarRestSharp

SugarRestSharp is a .NET C# SugarCRM/SuiteCRM Rest API Client. It is .NET C# Wrapper for the SugarCRM/SuiteCRM REST API Client.
MIT License
30 stars 12 forks source link

Add an email address to a new Lead on creation #5

Closed Trevor-Entellexi closed 6 years ago

Trevor-Entellexi commented 6 years ago

Hi,

thanks for the library firstly. My question is, how do I add an email address to a new Lead. I have the lead being created but I cant see where to add the email address(s).

TIA Trevor

mattkol commented 6 years ago

"thanks for the library firstly. " Thank you.

This is likely a limitation of the SugarCrm Rest Api. I am not quite sure this can be done via Rest successfully, but you can try.

Basically you need to insert data to 3 modules/tables, at least:

EmailAddresses(email_addresses) Email(emails) EmailsEmailAddrRel(emails_email_addr_rel)

But these 3 modules must be valid SugarCrm modules that be can created via Rest v4. This needs to be confirmed using get_available_modules. get_available_modules is not implemented here but was done for the Java version. I plan to implement it here too, but I have not had the time.

For more info on 6.5 Schema please see:

http://apidocs.sugarcrm.com/schema/6.5.0/ce/tables/email_addresses.html http://apidocs.sugarcrm.com/schema/6.5.0/ce/tables/emails.html http://apidocs.sugarcrm.com/schema/6.5.0/ce/tables/emails_email_addr_rel.html

In the "email" table, the parent_id links the email to "lead".

Please let me know if this is is useful or you need more info.

Trevor-Entellexi commented 6 years ago

Hi,

thanks for the info, will look at the references you supplied.

Cheers Trevor