Has NS recently changed something about the way se...
# suitescript
n
Has NS recently changed something about the way select field values are returned? I am doing getValue on a UE beforeLoad of a list type field and the return is an array ["1"]. I've seen this twice recently, it's a little "disconcerting".
k
Odd usually would just return the value 1.
just testing this using the same syntax and just returns the value not an array
n
Yeah... that's why I'm scratching my head. A couple weeks back I hit the same thing and just took it on the chin as an oddity specific to this account / customer / project since it wasn't anything I'd encountered in the last 9 years. Seeing it again today has me concerned. I pull other values from fields that are list type and they behave as expected. the code is literally:
let tranRec = context.newRecord;
let tranPODept = tranRec.getValue({fieldId:'custbody_3en_purchasing_department'});
k
Is the list record a custom list record?
n
I pull the equivalent value from employee record:
let empRec = record.load({type:record.Type.EMPLOYEE,id:userid});
let empPODept = empRec.getValue({fieldId:'custentity_3en_purchasing_department'});
and that comes back as 1.
Both the custbody and custentity fields use the same source list.
k
I am assuming it is a custom list or just using the netsuite department record?
n
OK I'm just going to go back and delete everything I posted here because, in my absence some kind soul has changed the field on the employee record to multiselect 🤦‍♂️ And I'm looking at that value in the script log. I'll get me' coat...
🙌 2
k
HAHHAHAHAHA well yeah multiselect would do that.
n
Damnit staring at this 30 mins and just as I post here I figure it and look a right plum. Oh well, next time I'll message you for a rubber duck session 🤣
k
HAHA no problem. It's my first day back so made my brain wake up!
s
I was going to say.. that looks like the multiselect behavior.. but the screenshot threw me off!
@NElliott probably time to restrict access to that custom field!
n
@suitedev It makes perfect sense to be a multiselect, so I'm good with that, just threw me a curve ball for a few. To be fair I tripped myself up cross referencing two fields with similar ids in two browser tabs 🤭 Unfortunately on those odd occasions where I trip myself up I seem to then go on to post here about it 😆
🤣 2
s
haha. I’m sure I’ve done that before.