1

I am creating an SOAP upsert request and attempting to use the fieldsToNull tag to blank out a date field after it has already been given a value. I keep getting an INVALID_FIELD error. Bellow is the code snippet.

<fieldsToNull>
     dateField__c
</fieldsToNull>

After sending the request the response throws and error as shown below.

   <faultstring>
        INVALID_FIELD: No such column ' dateField__c' on entity 'Contact'. 
        If you are attempting to use a custom field, be sure to append the '__c' 
        after the custom field name. Please reference your WSDL or the 
        describe call for the appropriate names.
   </faultstring>

I have checked spelling for the field and copied the API field label. I have also checked field accessibility and security to the user account making the change and it has read and editable access to that field. I saw on some other questions that this could be a pre version 28 issue, however SOAP version 33 is what we are using.

What else am I missing to still receive this error? And is there another way to blank, or null out this date field using a SOAP upsert request after the field has been given a value?

3
  • 2
    Try removing the white space (i.e. <fieldsToNull>dateField__c</fieldsToNull>). The error has an extra space before the field name, which might be why it is failing.
    – sfdcfox
    May 18, 2017 at 14:04
  • You are a hero. That worked. Please put this as the answer and I can mark it correct for you. May 18, 2017 at 14:29
  • I actually didn't know this about the API, it was just an educated guess. Glad I learned something new today.
    – sfdcfox
    May 18, 2017 at 14:31

1 Answer 1

1

The API expects no white space surrounding the field name, so it must be written all on one line with no white space:

<fieldsToNull>dateField__c</fieldsToNull>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .