I am trying to get a client script to send an erro...
# suitescript
a
I am trying to get a client script to send an error when saving a credit memo with an inactive item. For some reason this doesn't work even though it is literally the example in the documentation: curRec.getCurrentSublistSubrecord({sublistId: 'item', fieldId: 'item});
e
are you simply missing a single quote after ’item?
a
no, I have a work computer that won't allow slack so I hand typed it
b
What example are you trying to follow. To my knowledge, there is no subrecord in a column named item
j
I think @aerin is looking at the example code for
CurrentRecord.getCurrentSublistSubrecord(options)
SuiteAnswers 51534 https://netsuite.custhelp.com/app/answers/detail/a_id/51534 AFAIK the item field is not a subrecord and the example code is very misleading.
b
I would say the example is wrong, but the little note at the top says
It is not a functional example
. Its still garbage
In regard to the use case, NetSuite should already give a warning if you try to transform a credit memo with an inactive item
if you still want to give another error message, you will probably want to do an item search to check if the item is inactive
a
thank you, that sounds like a great idea