You need to sign in to do that
Don't have an account?
mschmidt
set field to blank using sforce.connection.update()
Hello everybody,
I'm trying to set a record's field to blank using the function sforce.connection.update().
Here is my code:
That works absolutly fine as long as bookmark is not empty.
But I want to be able to set the Bookmark__c field to be blank as well. How can a do that?
I tryed something link: bookmark=null and bookmark="". But non of them worked.
Seems like the method simply ignors the field if it is set to null or "".
Has anybody an idea??
Thanks,
Matthias
I'm trying to set a record's field to blank using the function sforce.connection.update().
Here is my code:
Code:
newObject = new sforce.SObject("DocumentLink"); newObject.set("Id", linkedDocs[i]["Id"]); newObject.set("Bookmark__c", bookmark);
// update Document Link object var result = sforce.connection.update([newObject]); for (var k=0; i<result.length ;k++ ){ if (result[k].getBoolean("success")){ } else { alert("Failed to store the bookmark changes! \n"+result[k]); } }
That works absolutly fine as long as bookmark is not empty.
But I want to be able to set the Bookmark__c field to be blank as well. How can a do that?
I tryed something link: bookmark=null and bookmark="". But non of them worked.
Seems like the method simply ignors the field if it is set to null or "".
Has anybody an idea??
Thanks,
Matthias
Setting bookmark = " " seems to do the job. A bit odd, isn't it!
Cheers,
Matthias
newObject.Bookmark__c = null;
This seems to work in every browser but Chrome. When I try to save an object with one of the fields set to " " (with the space), I get a javascript error:
"Uncaught {faultcode:'soapenv:Client', faultstring:'Missing entity type information. sObject requires a separate 'type' field be sent.', }"
This causes the save to fail completely. Does anybody happen to know the way of clearing a field that works in Chrome?
Hi, I am also getting this same error with "Chrome" only. any updates on this issue?
thanks,
Ravi.
http://www.salesforce.com/developer/docs/api/Content/sforce_api_calls_concepts_core_data_objects.htm