You need to sign in to do that
Don't have an account?
Daniel Wray
FIELD_INTEGRITY_EXCEPTION CONTACT\LEAD ID: id of incorrect type 0053*********fmAAA
Hi, I am recieving a " FIELD_INTEGRITY_EXCEPTION CONTACT\LEAD ID: id of incorrect type 0053*********fmAAA" exception when trying to create a task for the person logged in. I am passing a 18 digit character/number string of the person logged in.
Here's the code:
//create activity on account to record update
var newActivity = new Sforce.Dynabean("Task");
newActivity.set("Subject", "message " + variable);
newActivity.set("WhoId", accId);
newActivity.set("Status", "Completed");
newActivity.set("Priority", "Normal");
newActivity.set("Description", variable);
var today = new Date();
newActivity.set("ActivityDate", today);
var newActivity = new Sforce.Dynabean("Task");
newActivity.set("Subject", "message " + variable);
newActivity.set("WhoId", accId);
newActivity.set("Status", "Completed");
newActivity.set("Priority", "Normal");
newActivity.set("Description", variable);
var today = new Date();
newActivity.set("ActivityDate", today);
// no brackets!! hasnt worked
var saveResult = sforceClient.Create(newActivity)[0];
// no brackets no [0] hasnt worked
var saveResult = sforceClient.Create(newActivity);
var saveResult = sforceClient.Create(newActivity);
// original code not working
var saveResult = sforceClient.Create([newActivity])[0];
alert(saveResult);
var saveResult = sforceClient.Create([newActivity])[0];
alert(saveResult);
I would really apreciate if someone could help, thanks!! Anita
You are passing in an id for a user, but "whoid" is for Contacts. (Do a search on on whoid, there's been threads describing its use).
You probably want to set the ownerId instead.