You need to sign in to do that
Don't have an account?
rachvill
fieldsToNull does not work
Hi,
fieldsToNull does not work in my code. I have a custom object, that has a custom field being set to null. I checked the definition and field that I'm trying to set to null is Nillable.
rec.fieldsToNull.push("Last_Name__c");
var saveResult = rec.save();
//alert(saveResult);
if (saveResult.className == "Fault") { //error
alert("There was an error: " + saveResult.toString());
return false;
}
return true;
Any help will be very much appreciated.
Rachel
fieldsToNull does not work in my code. I have a custom object, that has a custom field being set to null. I checked the definition and field that I'm trying to set to null is Nillable.
rec.fieldsToNull.push("Last_Name__c");
var saveResult = rec.save();
//alert(saveResult);
if (saveResult.className == "Fault") { //error
alert("There was an error: " + saveResult.toString());
return false;
}
return true;
Any help will be very much appreciated.
Rachel
Here's the resolution for my problem above.
rec.fieldsToNull.push("Last_Name__c");
rec.set("Last_Name__c","");
Just setting the field to "" does not work. Both lines of code are needed to make the field null. I don't know why. But it works.
Quick search of the forums reveals this post.
http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=617
Message Edited by DevAngel on 11-15-2006 09:31 AM
Code: