Setting_multiple_select_field_with_submitFields.js
# suitescript
j
Setting_multiple_select_field_with_submitFields.js
l
That doesn't seem to work. It even sets the field empty if something is already there
j
I've used it before and just tested again and works in my test. Documentation indicates the values for multiple select should be string, even though my test contradicts that point. There's no other scripts or workflows that watch over the multiple select field?
l
No, nothing watches over it. I tried all possible combinations of string, numbers, nothing seems to work. I always thought it doesn't work and since I joined this group last week and hit this today again I thought someone will confirm it 🙂
ok, so the problem is it doesn't work in console. I just tried in UE script and it works
j
Browser console? How were you invoking the function to work in the console?
l
message has been deleted
j
did that console.log('end') print out. submitFields returns the id of the record it updated did it return the id?
l
yes and yes
j
Tried in console doesn't seem to work, it invokes submitFields and returns the id but just erases the values
You said works in UE script have you tired in 2.0 Client Side
l
not yet, but I expect it to not work as well. but anyway, I will need it in suitelet, I was just doing some analysis for solution I'm designing, so hopefully it will behave the same as in UE since both are server side scripts
n
The problem here is you are using submitField, Which means the record was updated from the console on the server but the form still would show/empty or whatever was there in the UI. And you again save the record from UI, which doesn't reflect those submitted Values on the form, so when the form is submitted, it again updates it to whatever was updated in the UI/form object. This might be confusing, but it will come clear if you will examine the System Notes/History of the updated record for this multi-select field.