I have a field called ‘AdjTotal’ which is the sum of a number of fields.I have a number of approvers that need to be notified and approve the document then pass onto next approver. When the L1 Approval Button is selected it needs to send a link to either L2, L3 or L4 for approval depending on the total of the ‘AdjTotal’.
The code below works for the ‘greater $1000 and greater $5000’. I need to add the’ less than $1000’ but nothing I tried works.
L1 Approval Button
tmpYesNo := @Prompt([YesNo]; “Approve Adjustment”; “Do you want to approve this adjustment?”);
@If( tmpYesNo = 1 ; @Success ;
@Do(FIELD L1Status := “Not Approved” ;
FIELD L1ApprovalDate := “”;
FIELD L1ApprovedBy := “Rejected By” + @Name([CN] ; @UserName) ;
@Return( “” )));
FIELD L1Status:= “Approved”;
FIELD L1ApprovalDate := @Today;
FIELD L1ApprovedBy := @Name([CN] ; @UserName);
SendTo2:= L2SupplyChainMgr : L2Backup;
SendTo3:= L3SupplyChainVP : L3Backup;
SendTo4:= L4GroupFinancialOfficer : L4Backup;
SendTo5:= L5ChiefFinancialOfficer : L5Backup;
SendTo := @If(AdjTotal>=5000;SendTo3;SendTo2 );
@MailSend(SendTo;“”;“”;(“NOTIFICATION: GDT Warehouse Stock Adjustment Request”) : “”;“”;"NOTIFICATION: Please review and Authorise Stock Adjustment ";[IncludeDoclink])
I have FIVE Approval Levels.
L1 Approval (button)
L1 needs to SendTo L2 if greater than $1000
L1 needs to SendTo L3 if greater than $5000
L1 needs to SendTo L4 if less than $1000
L2 Approval (button)
L2 needs to SendTo L4
L3 Approval (button)
L3 needs to SendTo L4
L4 Approval (button)
L4 SendTo L5 if greater than $50,000
L4 SendTo or back to RequestorName (field name)
L5 Approval (button)
L5 SendTo RequestorName (field name)
Your help would be very appreciated.