Can anyone shed any light on why my SuiteLet funct...
# suitescript
k
Can anyone shed any light on why my SuiteLet function is not working?
Copy code
function approveRejectOrder(poID, recordType, statusId) {
                var poRecord = record.load({type: recordType, id: poID});
                poRecord.setValue({fieldId: 'approvalstatus', value: statusId});
                var itemSublistCount = poRecord.getLineCount({sublistId: 'item'});
                for (var i=0; i<itemSublistCount; i++) {
                    poRecord.setSublistValue({sublistId: 'item', fieldId: 'custcol_po_item_approval', value: statusId});
                }
                poRecord.save();
            }
r
Code looks good, what is the issue?
k
I didn't add line into set sublistvalue.