JavaScript function: skipApproval

Prevents an item's approval status from being reset to "pending."

Syntax

ApprovalItem.skipApproval (isChanged, finalstatus, lCartItemFile);

Arguments

The following arguments are valid for this function:

Name Data type Required Description
isChanged Boolean Yes This argument indicates whether the cart Item is changed.
finalstatus String Yes This argument contains the latest cart item’s approval status
lCartItemFile Datum object No This argument is the cart Item object.

Return values

A boolean value: true or false

If the function returns true, the item approval status is not reset to "pending."

Description

You can modify the implementation of this function base on your organization's own business logic.

Example

In OOB, if the item is not changed, and the approval status is not denied, you can skip resetting the approval status to pending.

function skipApproval(isChanged, finalstatus, lCartItemFile){ 
       
    if (isChanged !=null && finalstatus!= null && isChanged==false && finalstatus !="denied") {
       
       return true;
       
    }else {
    
       return false;
    } 
}