How to approve a custom record using client or user event script

 let actions = action.find({
        recordType: 'timebill',
        recordId: recordId

    });

    log.debug("We've got the following actions: " + Object.keys(actions));
    if (actions.approve) {
        let result = actions.approve();
        log.debug("Timebill has been successfully approved");
    } else {
        log.debug("The timebill is already approved");
    }

Leave a comment

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