4

I am using Salesforce Soap API (Version 33). I have created a .Net project and consumed their WSDL file in the project. I want to update a Custom Object using the update command.

The above functionality is working fine.

The only problem I have is that when I update null fields in Salesforce to a new (non-null) value, the fields do not get updated with the new value. Any field having a non-null value prior to the update, gets the updated value.

I want to know if there is flag or a header that needs to be set before calling the update to get around this problem. Any help would be great.

Thanks, MAli

2
  • Are you using the .net toolkit? Try specify additional "specified" flag for those fields. For an example if you're updating SObject.CustomField__c, also specify SObject.CustomField__cspecified = true;. See if that works – Boris Bachovski Apr 29 '15 at 2:35
  • I am not using .net tookket. The "SObject.CustomField__cspecified = true;" works :) . Thanks Bachovski – MAli Apr 29 '15 at 3:57
3

Some of the fields based on their type are not part of the SOAP message and you need to explicitly specify that by appending the specified keyword to the field

SObject.CustomField__cspecified = true

In order to ensure that the field will be a part of the SOAP message. I still haven't seen official documentation around this - I discovered it the hard way :)

2
  • Thanks for the answer. I did not find any documentation as well for "Specified" attribute. I am using the Enterprise WSDL, so I might need add an extra line of code per field. – MAli Apr 29 '15 at 4:16
  • That's right, for each field that's causing dramas, you'll need to do the above. – Boris Bachovski Apr 29 '15 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.