Trigger on client script when removing line items

There is a client script entry point called SublistChanged() and it will trigger on sublist change button action.

Each trigger can be identified by using context.operation method.

 function sublistChanged(context) {
        var currentRecord = context.currentRecord;
        var sublistName = context.sublistId;
        var op = context.operation;
        if (sublistName === 'item')
            currentRecord.setValue({
                fieldId: 'memo',
                value: 'Total has changed to ' + currentRecord.getValue({fieldId: 'total'}) +
                       'with operation: ' + op
            });
    }

Leave a comment

Your email address will not be published. Required fields are marked *