In SuiteScript I have a float type field in Suitel...
# suitescript
b
In SuiteScript I have a float type field in Suitelet. In client script, I wanted to clear that field value so I setValue as null. But the form shows as 'null'
Copy code
form.setValue({
                fieldId: 'custpage_amount', 
                value: null, 
                ignoreFieldChange: true
            });
How can I clear that field?
a
NetSuite is not very consistent when it comes to clear fields with different field types, sometimes you need to set values to: • null • '' • boolean
This is a list I put together a while ago and I use within a function to dynamically clear fields:
Copy code
const oClearMethods = {
    currency: '',
    select: '',
    date: null,
    datetime: null,
    checkbox: false,
    text: null,
    datetimetz: null
};
b
Thank you @alien4u
r
For decimal and integer '' works if I remember right, when done through ui/client.
s
It's supposed to be
null
- for serverside scripts. for the
custpage_xxx
you're using the values are strings, so empty string should work.
but I concur with @alien4u that NS is not consistent - even with their own documentation on this topic.
b
Thank you all