- My View
I have a requirement where I need to send the future approvals of the catalog item in the email notification when the first approval email is sent out.
i.e. when an item is pending on approval from A, and according to workflow the approval will go to B and C,after A approves the approval email should contain the names of the future approvers.
Please let me know is there any way we can determine to whom the future approvals will go (through script)
It depends on how you determine who the approvers are. In the 'Approval - User' workflow activity, you can use the advanced option to query the database and obtain this information. You can do a similar thing using the 'Run Script' activity. I would obtain the list of approvers and store that in the 'description' field, or some other custom or hidden field of the RITM. You can then query for that value in the approval email and add it to the notification.
Hope that helps!
You can use run script to set the future approvals in workflow.scratchpad variable. use the scratchpad value when ever you want and in user approval activity.
Mark Correct /Helpful /Like based on the effect of response.
You can use the Generate activity in the workflow (Generate workflow activity) prior to the approvals. This will generate the Approvals as Pending in the Approval list. While this does not add them to the email notification, it does allow the approvers (who can view the original record and see the list of approvers) to see upcoming approvers without any scripting.
I believe you will need to do this before you can leverage Tim and Deepak's suggestions, as you need to have the Approval records generated before you can write a script to query for the sysapproval associated with the record you want to approve, then pull that information into the scratchpad.
Ben Sweetser, Principal Business Process Consultant
Thanks guys for the suggestions. The generate workflow activity seems to be promising.
However, I am using the approval definitions instead of the workflow to actually generate approvals.
I can pull the data from the approval definition, but in some definitions, we have scripts to determine the approvals where I am not sure how to pull the approver from that.