[progress Communities] [progress Openedge Abl] Forum Post: Re: Approvals Application...

  • Thread starter Thread starter Shiva Duriseati
  • Start date Start date
Status
Not open for further replies.
S

Shiva Duriseati

Guest
Hi Simon, Apologies for delay in getting back. You mentioned that "Starting the approval process prompts the user to select the list of approvers from the default list." If your record has to be approved by two users then you need to create two "Workflow Actions" of type "Start Approval Process" with default user selection respectively. After creating these two wf actions two triggers need to be created which will start above two processes.Now the main wf action of type "Run selection triggers" would make these triggers start the process. There is no direct way to have 2 level or 3 level of approval but still you can do it by making use of existing API'S. Following are the steps which I've performed for two level approvals. Whenever a record is created it will display "Start Approve Process" once user clicks then it will send it to User1 for approval once User1 approves the record then email will be sent to User2 for his approval after approve came from user2 then only the status changes to "Approved" until then the status would show "Approval In Process" 1)Create two users user1 , user2 and make them as approvers. 2)Create two "Workflow Actions" of type "Start Approval Process". "StartApprovalProcessFromOne" in which selected approver should be user1. "StartApprovalProcessFromTwo" in which selected approver should be user2. 3)Create a picklist field( SamplePicklist ) with values " YES " and " NO ".(Sole purpose of this field is to determine current update made from user in other words it is used as a "Flag") 4)Create a trigger( ex:StartUserOneApproval ) of type " Object Script" without enabling timing options and use the following code. rbv_api.updateRecord("SampleObject", {!id}, {"IsApprovedFromUserOne":"YES"}); rbv_api.startApproval("SampleObject", {!id}, "Pbc0kXgTSxuEei_EchM-Tw"); 5)Create another trigger( ex:StartUserTwoApproval ) of type " Change Workflow Status ", enable " After Update " timing option and use following code.From trigger properties change workflow status to " Approval In Progress " if("{!SamplePicklist#value}"==="YES" && "{!status#value}"==="Approved"){ rbv_api.updateRecord("SampleObject", {!id}, {"IsApprovedFromUserOne":"NO"}); rbv_api.startApproval("SampleObject", {!id}, "Z_pSZw9rQGOgbC_O0SLjOw"); } 6)Now create a workflow action (ex: Start Approval Process )of type "Run selected triggers" and from the available triggers select "StartUserOneApproval" trigger The above process works as follows: Whenever a record is created and a user clicks on " Start Approval Process " then trigger " StartUserOneApproval " gets executed which sends an email to " user1 " for approval,at the same time it will change the picklist value to " YES " and workflow status to " Approval In Progress ". Now when " user1 " approves the record the status has to be changed to " Approved " but we need to restrict it because until " user2 " approves we shouldn't update the status hence another trigger " StartUserTwoApproval " which will verify for flag(in our case it is picklist) and Status accordingly it will start approval process for " user2 ". Finally status change to " Approved " only after getting approved from " user2 " Please let me know if need any assistance on this. Regards, Shiva

Continue reading...
 
Status
Not open for further replies.
Back
Top