Sales rep change the quantity of item from 5 to 6 ...
# suitescript
j
Sales rep change the quantity of item from 5 to 6 .How can i disable/restrict changing Sales Order line item if already been invoiced?
j
@JMS, I do something like this
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @Author Jack Arens | National Food Group
 */
define(['N/ui/serverWidget'],
    function(serverWidget) {
        function beforeLoad(scriptContext) {
            var record = scriptContext.newRecord;
            var status = record.getValue('statusRef');

            if(status === 'fullyBilled'){
                scriptContext.form.getSublist('item').getField('quantity').updateDisplayType({displayType: serverWidget.FieldDisplayType.DISABLED});
            }
        }
        return {
            beforeLoad: beforeLoad
        };
    });
And then this script is deployed to the restricted roles.
Oh, also a thought. You should lock the rate and amount fields too I'd think.
j
Thanks you @jarens ..It works