Is this a defect? I have 3 custom multiselect fie...
# suitescript
b
Is this a defect? I have 3 custom multiselect fields on a custom record type. The only difference between each field is the list/record. Each field has a different list/record: Employee, Item, Transaction. In a user event beforeSubmit on the custom record, I'm setting the values of those 3 fields. Setting multiple values works just fine for the Employee and Item fields, but it doesn't work for the Transaction field.
Copy code
newRecord.setValue({
  fieldId: 'custrecord_employees',
  value: [4942, 8],
});
newRecord.setValue({
  fieldId: 'custrecord_items',
  value: [4145, 5731],
});
newRecord.setValue({
  fieldId: 'custrecord_transactions',
  value: [3215, 4398],
});
Error Message
You have entered an Invalid Field Value 32154398 for the following field: custrecord_transactions
b
thats also the error message you get when you try to set invalid internal ids
so make sure that those are valid select options
same rules as the ui, if you cant set those 2 transactions in the ui, you cant in script
b
I verified that those IDs do exist
b
there are plenty of reasons that valid internal ids cannot be selected
existence is not enough
b
Okay, I'll test that by manually selecting values in the field and saving. Then I'll use the same exact values in my script.
Alright, that worked, so it's not a defect. What would be the criteria for the options of the field?
I don't have any manual filtering on the options.
b
usual suspects are permission or classification related issues
b
I’m in the Administrator role. How would I check for classification? I’ve got nothing related to that on my custom record.
b
usually administrator wouldnt have problems, unless you mean your script runs as administrator and the role you are using in the ui does not
b
UI and script are both admin
b
you probably have to take a closer look at the transactions you cant select and compare it to the ones that you can
t
Check if you have sourcing and filtering for that field. check. Also verify if you can actually set those transactions to the field in the UI
b
I have no sourcing or filtering. I have confirmed that I cannot set the field to those transactions in the UI.
s
I find it suspect that it returns an error for an internal id that is the concatenation of the two ids you're passing - as if they were combined as strings.
b
That’s why I was thinking it was a defect! But I think it may just be how the error message is formatted. That’s how it sloppily converts arrays to strings.
b
its not that sloppy, netsuite internally uses \u0005 as the separator for multiselects
which doesnt print properly
b
It’s sloppy because it makes it harder to understand the error message.