--> This is wrong!!! (See thread) --- Today I l...
# suitescript
e
--> This is wrong!!! (See thread) --- Today I learned - if you use search.lookupField to lookup a custom Text Area field, it will fail. When I switched the Text Area to a Free Form Text, everything worked fine.
s
I am a bit suspect of search.lookup - I usually prefer a real search or a record load depending on circumstances as those two seem most reliable. Granted, a bit more governance IIRC.
e
I hear you- unfortunately I'm using it on a validateLine entry point, so I feel like I need to save the governance. Luckily, my custom field doesn't really need to be a text area- it was just more aesthetically pleasing on the item record
UPDATE: The issue wasn't the field type but the id rather. My original id was "custitem_item_prompt" --- this failed. When I changed it to "custitem_prompt" it worked correctly (both Text Area and Free Form Text worked)
s
I hope you're saying you mistyped the internal id for the field name, not that you changed the internal id in NS and it magically started working?
e
So upon more testing- I created a field "custitem_originalid" I edited an item and put a value in that field I used search.lookup to pull that value - all good I then hit "Change ID" on the Custom Item and changed the ID to "custitem_newid" When you save the change to the ID, you're brought back to the Custom Item Field in edit mode If you don't save it... the field ID on the Item Record will show the new id ("custitem_newid") but you won't be able to access it with search.lookUp unless you hit Save on the Custom Item Field screen (which you will get the deceiving "no changes have been made... are you sure you want to save?" pop up)
m
Is this maybe more of an issue with the new field and/or ID update slowly propagating to everyone's active session? I've had issues before where I make a new custom field and then add some scripting with it and it works fine for me but not for other users until at least a couple hours later or if they log out/back in (much like permission updates).
d
I have seen this as well ^ usually when making update to existing record fieldid, I logout/in just to be safe
e
^ These could both be related. In my specific testing, as soon as I hit "Save" on the Custom Item Field screen (after changing the ID) I was able to pull the information in a script. With that said... I've not had other users try the script, so there definitely could be a delaying in the updating of the ID for other users.