In a userevent script deployed on item Receipt, i ...
# suitescript
r
In a userevent script deployed on item Receipt, i was checking if the quantity got changed in subsist level or not before submit it in edit mode. If it's changed I have to perform some task over it
Copy code
oldRecord = context.oldRecord;
This is giving the old record values, but when I am trying to do the below it is coming as null.
Copy code
oldLineCount = oldRecord.getLineCount({ sublistId: 'item' });
due to which i am not able to perform
Copy code
i_quantity_old = oldRecord.getSublistValue({ sublistId: 'item', fieldId: 'quantity', line: newLineCount });
I printed oldRecord, I can even see the old quantity in the object that was coming in logs But any sublist operation on oldRecord is just giving null.