The other day I came across a problem where sending in a blank field to Salesforce via SOAP was not nulling out the field. Instead, the enterprise WSDL was treating this as if nothing was sent, and therefore not updating the field at all. This make sense. If you were to send a sparse data structure over with only fields you want to update, you wouldn’t want to either have to provide the current value of every field or have them all nulled out. So, how do you null out a field with SOAP via the enterprise (or partner) WSDL in Salesforce?
NOTE: This is input is formatted for SoapUI, it may differ depending on the client you are using to send the SOAP message. The key take away is fieldToNull urn.
Lets start with a simple example of updating a field via the Enterprise WSDL
This will set the CustomField__c on the Contact to “Yay! Data”
To null out this field we simply send the field name as part of the fieldsToNull list
Well hello there. My name’s Patrick and I’m a pretty technical guy, and I love technical things.
This is blog about stuff that I’ve discovered while working. I might throw random crap in here, but for the most part it will be pretty technical, and may have random bursts of code.
To learn more about me head over to my aptly names about.me page where you can find all the links to my twitter, website and the like.