function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aditya312Aditya312 

Approval Process

I need to create a approval process in following way:

Lets say there are some formula fields department1, department2, department3 ...... department20 which populates as YES/NO based on some logic.

According to these department fields, the approval process will execute in following way:

Step1 - department1
Step2 - department2
Step3 - department3
Step4 - department4
Step5(Parallel approval required) - department5, department6, department7, department8,.... department15
Step6 - department16
Step - department17
Step - department18
Step - department19
Step - department20

Now my problem is that, there are 10 departments to be included in Step5 but the condition is that only those departments approval is required whose respective formula field say 'YES'.

In that case I have to create 10*10 steps only for Step5 to meet all the combinations, like if (department5 & department8 is YES) or if (department6 & department7 & department9 is YES) and so on.

Is there any way to accomplish such a requirement without creating so many steps?
Any help will be greatly appreciated.
Best Answer chosen by Aditya312
BalajiRanganathanBalajiRanganathan
Yup. you are correct. but you have a workaround for that too. you can repeat the user value in those lookup field. for example if only department5 true, then all 10 fields can have user from department5.

All Answers

BalajiRanganathanBalajiRanganathan
it is not 10*10 combinations. it will be 2 power 10 combinations if you follow your approach.
who will be approving the step?. you can try creating 10 lookup fileds and populate the lookup field only if the corresponding formula field is true (using a trigger code). In the 5th apporval step,you can use the related user lookup fields to assign the steps.
Aditya312Aditya312
I got your point Balaji, but as per your suggestion if I will make 10 lookups for step5 and suppose if any one of those is not required then the trigger will not populate any value in its respective lookup and hence it will give an error of 'MANAGER NOT DEFINED'. So basically my concern is not related with the number of steps whether 100 or 1024, but with the dynamic nature of requirement which will lead to multiple approval processes or steps. I hope I made myself clear. Thanks so much for your help.
BalajiRanganathanBalajiRanganathan
Yup. you are correct. but you have a workaround for that too. you can repeat the user value in those lookup field. for example if only department5 true, then all 10 fields can have user from department5.
This was selected as the best answer
Aditya312Aditya312
I got your solution Balaji. I created such a trigger and it worked for me. Thanks so much for your help.