Is it possible to empty/deselect fields with one c...
# suitescript
a
Is it possible to empty/deselect fields with one command? or we need to know the field type first?
I have tried null and empty string but it didn't work. I want to set date, checkbox, radio, text, textarea and multiselect to empty or unselect.
s
setting a field value to
null
should clear a field for SuiteScript 2.x
a
@stalbert It will not work for some fields
like select, multiselect and checkbox
s
that's news to me.
a
at least in client script I have tried and it didn't work.
@stalbert this is the error
Copy code
You have entered an Invalid Field Value null
s
Ah, I've used that technique mostly in server scripts. Client scripts seem to be more fragile in general.
a
So what do you suggest? checking the field type?
@stalbert and if that's the solution how many type do we need to check? is it like setting different value for each type?
s
tis possible Client script is old-school (last I checked some of the so-called SS2.X apis client side were actually just passthrough calls to SS1 client side.
empty string
''
was used often in SS 1.x but it sounds like you've already tried that.
a
yes