Seapine Labs
Personal tools

Setting Drop-down Field Values

From Seapine Labs

Jump to: navigation, search

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:


  1. 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.
  2. 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.
  3. 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>.













Issue Management Software | Source Code Control Software | Test Case Management