You need to sign in to do that
Don't have an account?
Gelu G.
Rest API create account and return more fields
Hi,
We have person accounts enabled for our Salesforce instance. I am using the Rest API to create an account record. When an an account is created, there is formula field that gets calculated automatically to ge the long person contact id. Is there a way to specifiy this attribute in the response? I don't want to have to make a second call to get the long person contact id.
We have person accounts enabled for our Salesforce instance. I am using the Rest API to create an account record. When an an account is created, there is formula field that gets calculated automatically to ge the long person contact id. Is there a way to specifiy this attribute in the response? I don't want to have to make a second call to get the long person contact id.
Use return type id in the method :
insert act;
account acc = [select id,contactid from account where id =: acc.id];
return acc.contactid;
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Salesforce Freelance Consultant/Developer/Administrator/Trainer
@For Salesforce Project Support: varaprasad4sfdc@gmail.com
Salesforce latest interview questions and training videos :
https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1
Aren't you still making two calls; one for insert and another one that has the select statement? Our website is built on Node.JS and we are using the JSforce library for interacting with SF. The create method doesn't really have any other option that will allow us to specify extra fields we need. Any thoughts?