From Seapine Labs
If you use the SOAP SDK and try to change a drop-down field value to <not set>, the behavior may not work as expected. For example, the following code was used in a C# application:
((CDropdownField)defect.customFieldList[0]).value = null;
The developer wanted to change the field value to null (<not set>). However, the defect did not change. After some troubleshooting, the developer used the following code:
((CDropdownField)defect.customFieldList[0]).value = “”;
The difference? C# optimized this code and removed the null field from the response. The application then interpreted this to mean <not set>.
Keep the following in mind:
- You cannot set a drop-down field value to <not set> using the SOAP SDK because you can technically have a field value named <not set> and it would be ambiguous.
- You cannot set the value to null. Languages, such as C#, read null as the absence of a value and exclude the value from the request. When SOAP gets the request, it sees that a value does not exist, assumes no changes were made, and continues processing.
- You can use an empty string. Languages, such as C#, interpret this to mean there is a value but it is empty. When SOAP gets the request, it sees that an empty value exists, and interprets this to mean <not set>.