You need to sign in to do that
Don't have an account?
Update a lookup field with the Salesforce API using an external id
Hi !
I tried to create tasks with the REST API and update the "Name" field with a contact.
It worked well when I used "WhoId" : "00000WSSFSEFF",
but when I tried to use an external ID I got this error message :
[{"message":"Cannot deserialize instance of reference from START_OBJECT value { or request may be missing a required field at [line:7, column:21]","errorCode":"JSON_PARSER_ERROR"}]
URL : https://domain.my.salesforce.com/services/data/v20.0/sobjects/task
BODY :
{ "OwnerId": "0000XXX0000",
"Type": "Email",
"Subject": "Upsell",
"Status": "Not Started",
"Priority":"Normale",
"WhoId": { "ExternalId__c" : 4051 }
}
I also tried "Who": { "ExternalId__c" : 4051 }, and lots of other syntax but nothing worked.
Can you help me to solve this, please ?
can you please try below.
{ "OwnerId": "0000XXX0000",
"Type": "Email",
"Subject": "Upsell",
"Status": "Not Started",
"Priority":"Normale",
"Contact__r": { "ExternalId__c" : 4051 }
}
Regards,
Pawan Kumar
Hi Pawan !
Thanks for your response.
I got this error message : [{"message":"No such column 'Contact__r' on sobject of type Task","errorCode":"INVALID_FIELD"}]
I am getting the same error. Were you able to resolve this?