A custom dropdown field in sales order is hidden i...
# suitescript
r
A custom dropdown field in sales order is hidden in the customForm (show checkbox is not selected). Script is trying to create the sales order. in 1.0 nlapiSetFieldText sets the data. in 2.0 setText throws an error while saving the record.
Copy code
"You entered "abc" into a field where a numeric value was expected. Please go back and change this value to a number.",
Can someone provide solution for it? P.s. Do not want to hard code the mapping. And getField and getSelectOptions is not workng as getField is coming as null.
t
One way is this. I assume the field you are trying is a “List” sourced field and not Record; in that case, you can load the list in real-time, create a map(obj) and use that. No hard-coding is needed. After making so many mistakes, I avoid putting texts into the fields.
r
Was trying to avoid additional load/search calls in the script. Can also just search for it right instead of loading the list and create a mapping object. Works like a charm in 1.0, not sure why they made 2.0 behave this way.