You need to sign in to do that
Don't have an account?
Dineshram
Linking Contacts to Account
All,
Please let me know, how do I link Contact to an Account through webservices API.
I am able to create contact through API, but not able to link to an Account.
Tried updating setContacts in Account(to existing account), after creating the contact. But, no luck.
Any pointers are appreciated.
Thanks.
You have to set AccountId field on Contact. Which will make sure to link contact with account.
As follows .... while you creating contact.
Contact con = new Contact();
.
.
con.AccountId = ACCOUNT_ID_VARIABLE;
.
.
Where you have to replace ACCOUNT_ID_VARIABLE with appropriate Account SFDC Id.
Hope this would help.
Cheers,
V.R.
All Answers
Forgot add the following.
Got INVALID_FIELD: No such column 'Contacts' on entity 'Account'., when try updating with setContacts
You have to set AccountId field on Contact. Which will make sure to link contact with account.
As follows .... while you creating contact.
Contact con = new Contact();
.
.
con.AccountId = ACCOUNT_ID_VARIABLE;
.
.
Where you have to replace ACCOUNT_ID_VARIABLE with appropriate Account SFDC Id.
Hope this would help.
Cheers,
V.R.