Skip to content

Instantly share code, notes, and snippets.

@pcon
Created August 9, 2012 19:58
Show Gist options
  • Save pcon/3307545 to your computer and use it in GitHub Desktop.
Save pcon/3307545 to your computer and use it in GitHub Desktop.
Null fields in SFDC via SOAP
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>${#Project#sessionid}</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:update>
<!--Zero or more repetitions:-->
<urn:sObjects xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Contact">
<urn:Id>${#Project#contactid}</urn:Id>
<urn:fieldsToNull>CustomField__c</urn:fieldsToNull>
</urn:sObjects>
</urn:update>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>${#Project#sessionid}</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:update>
<!--Zero or more repetitions:-->
<urn:sObjects xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Contact">
<urn:Id>${#Project#contactid}</urn:Id>
<urn:CustomField__c>Yay! Data</urn:CustomField__c>
</urn:sObjects>
</urn:update>
</soapenv:Body>
</soapenv:Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment