ANS-0383 · WEB SERVICES & INTEGRATIONS
How to Clear or Set Custom Field Values to Null via NetSuite Web Services?
Understand the correct method for managing empty custom field data when integrating with NetSuite through SOAP web services.
Short answer
NetSuite web services do not accept blank values for custom fields. To clear an existing custom field's value, utilize the nullFieldList property in your web services request. If you do not have a value to provide for a custom field, simply omit the corresponding element from the SOAP request entirely.
Scenario
Users attempting to integrate with NetSuite via web services often encounter issues when trying to set custom fields to blank or empty values. Even for non-mandatory custom fields, providing an empty string or spaces within the SOAP request for a custom field value results in a failed response from NetSuite.
Solution
NetSuite web services do not accept blank values for custom fields, even for non-mandatory ones. Providing an empty string or spaces for a custom field value will result in a failed web services request.
To avoid setting a value for a custom field
If there is no value to be provided for a custom field, do not include the custom field element in the SOAP request at all.
To reset or delete the value of an existing custom field
Utilize the nullFieldList property within your web services request. This is the designated method for clearing a custom field's data.The following example illustrates an unsuccessful attempt to set a custom field to a blank value, which will be rejected by NetSuite:
Request: <platformcore:customfield xsi:type"platformCore:StringCustomFieldRef" internalid"custbodydgtest"><platformcore:value> </platformcore:value> </platformcore:customfield>Response: <platformCore:status isSuccess"false" xmlns:platformCore"urn: core_2010_1.platform.webservices.netsuite.com"&Expert NetSuite Support
Need help with this NetSuite issue?
Web Services & Integrations consulting and configuration support
