You need to sign in to do that
Don't have an account?
GerhardNewman
Setting a field to NULL does not work.
I found lots of other posts on this topic and none of the solutions offered work.
I've tried fieldsToNULL by itself
I've tried fieldsToNull together with .set
I've tried just .set
With the code as it is below, it runs fine without error, but the field is not updated.
Someone please help! BTW I am using Winter 08 in sandbox.
var myObj = new sforce.SObject("Lead");
myObj.Id = records[i].Id;
//myObj.set("Spotzer_Web_ID__c", null);
//myObj.fieldsToNull = [];
//myObj.fieldsToNull.push("Spotzer_Web_ID__c");
myObj.set("Spotzer_Web_ID__c","");
sforce.connection.update([myObj]);
myObj.Id = records[i].Id;
//myObj.set("Spotzer_Web_ID__c", null);
//myObj.fieldsToNull = [];
//myObj.fieldsToNull.push("Spotzer_Web_ID__c");
myObj.set("Spotzer_Web_ID__c","");
sforce.connection.update([myObj]);
myObj.set("Spotzer_Web_ID__c", null);
Unless it's a required field...
If there's any kind of data validation going on, it could prevent the field from being set to null.
I just tried that before reading your post, and yes you are correct, all of my records are failing to update due to another problem.
I missed this due to the documentation on how to set to null being a bit vague (actually I could not find any at all) and getting a bit lost in my numerous tests. Obvious problem captian obvious.
Thanks for your help.