Removing Mark Packed Button from Item Fulfillment record

At the moment is not possible to remove the Mark Packed button through Workflow. However, an alternative solution using SuiteScript is possible as it is described. A user event script can be used to throw an error whenever the mark packed button is clicked without satisfying the criteria.

The code is given below.

const beforeSubmit = (scriptContext) => {
            let newRcd = scriptContext.newRecord;
            let picklistCheckBox = newRcd.getValue({
                fieldId: 'custbody_jj_pick_list_printed'
            });
            log.debug("picklistCheckBox", picklistCheckBox);
            log.debug("scriptContext.type", scriptContext.type);
            if ((scriptContext.type == 'pack' || scriptContext.type == 'ship') && !picklistCheckBox) { //checks if the button Mark as packed or Marked as Shipped is clicked
                const message = 'Print the Pick List by clicking the button before pack or ship.'
                throw errorForPrint(message);
            }


        }
        function errorForPrint(mssg) {
            let errorObj = error.create({
                message: mssg,
                name: 'PRINT_PICK_LIST_MANDATORY',
                notifyOff: true
            });
            return errorObj.message;
        }

Leave a comment

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