I have a form on my ASP.NET (C#) website that updates a set of custom entity fields via the NetSuite web service. The form allows for our users to change their answers, potentially clearing previous answers.
For most of the questions asked on my form, clearing the data is straight forward (to a degree): I check the form field value, and if the Length of the value is 0, then I set the NetSuite custom entity field value to be '-' (dash).
One field on the form is a Date. I'm not sure how to clear this value in the corresponding NetSuite date custom entity field.
Here's how I handle the Free-form Text based custom entity fields:
string myuse_systems_learning_cf_value = "-"; if (myuse_systems_learning.Checked) { myuse_systems_learning_cf_value = myuse_systems_learning_value.Text.ToString(); } NetSuite.NetSuiteAPI.StringCustomFieldRef myuse_systems_learning_cf = new NetSuite.NetSuiteAPI.StringCustomFieldRef(); myuse_systems_learning_cf.internalId = "custentity_myuse_systems_learning"; myuse_systems_learning_cf.value = myuse_systems_learning_cf_value; custFieldRefs[8] = myuse_systems_learning_cf;I'm sure there's a better way to do this, and this method wouldn't work for a Date field.I tried using "" (i.e. a blank string) for the StringCustomFieldRef items and that failed to clear the NetSuite value, so I decided to write '-' instead, but I can't add '-' into a Date custom entity field. So, how can I clear values in NetSuite custom entity fields when someone clears their answer in my website form, especially when that field is a Date?Cheers