Using the ValidateLine function on a client script...
# suitescript
g
Using the ValidateLine function on a client script when adding an item to a sales order. I need to get some item/product info and therefore need to load the item record. However it seems you need the internalID to load the item record which I cannot seem to find on the sales item. Any advice Please would be greatly appreciated
b
have you tried getting the internal id from the item field?
g
var iId = currentSO.getCurrentSublistValue({ type: 'item', fieldId: 'internalid', sublistId: context.sublistId }); ?
doesnt work. returns undefined
b
thats not how you use that method
importantly, fieldId should be id of the field on the sublist
g
it works for item display name and the quantity
b
and how did you use it there
g
same, just changed the fieldid
b
you arent getting the item field, you are getting the internalid field
which doesnt exist on the item sublist
g
not the internal id
no it returns the item name/number
b
you arent describing normal suitescript behavior for fields. getCurrentSublistText will get you the display text of a select field. getCurrentSublistValue will get you the internal id value.
👍 1
g
Thanks!! Your right!
Its working now!
I really appreciate it