Activity Forums Salesforce® Discussions How we can achieve dynamic approval process in Salesforce?

  • Avnish Yadav

    Member
    September 27, 2018 at 6:17 am

    It is possible through apex triggers because in standard approval process, you need to define approver while creating approval process.

  • Parul

    Member
    September 28, 2018 at 8:06 pm

    Dynamic approval routing allows you to specify the approvers for each record using User lookup fields on the record requiring approval. The fields are populated using Apex, using data from a special custom object (the "approval matrix") that contains all the information needed to route the record. The approval process then uses the values in the lookup field, rather than the limited pool of users available in the so-called static process. This provides more flexibility: you could route to different people based on region or some other criteria related to the record, rather than having to write multiple static approval processes in order to perform the same functionality.

    The steps for dynamic approval routing are:

    Create lookup fields on the object being approved.
    Create a custom object that will be used as an approval matrix.
    Populate the approval matrix.
    Create Apex code to fill in the lookup fields on the record, from the approval matrix.
    Create or update an approval process to utilize the new lookup fields.

    For example: suppose you have a position object and there are 3 levels of approvers. You need to route the record to different approvers based on the department and pay grade. You would:

    Add custom lookup fields (to User) on the Position object, called Approver 1, Approver 2, and Approver 3.
    Create an approval matrix object that stores all the fields used in routing: pay grade, department, and lookup fields to the User object for each approver.
    Create the approval matrix records. For position, one might route records with the department of Engineering to high-level Engineering managers as approvers, whereas the department of Sales would have high-level Sales managers as the approvers.
    Use an Apex trigger to populate the lookup fields on the Position record when the record is created, based on the values in the approval matrix.
    On the approval process, in the approval steps, set the Assigned Approver to the appropriate lookup field on the record (Approver 1, Approver 2, and Approver 3).

  • Avinash

    Member
    April 21, 2023 at 6:54 am

    Thanks

  • Shuvam

    Member
    May 15, 2023 at 4:03 pm

    Hi everyone,
    In Salesforce, you can achieve a dynamic approval process by using the "Related User" option when setting up the process. This allows you to route approvals to a user specified in a field on the record. Here's a brief rundown of how you might do this:

    1. In Salesforce, navigate to "Process Automation" then "Approval Processes".
    2. Select "New Approval Process" and choose the "Standard Setup Wizard".
    3. Set up the basic information, including the object you're working with (in your case, Position) and the criteria for which records should enter this approval process.
    4. When defining the Approval Steps, you'll be asked to specify the "Approver". Instead of choosing a specific user, choose "Related User".
    5. Then, you can select the "Hiring Manager" field. This means that the user specified in the "Hiring Manager" field on the Position record will be the one asked to approve it.
    6. Continue setting up the approval process as required, including email alerts, escalation rules, and so on.

    This way, the approval process dynamically adjusts based on the user specified in the "Hiring Manager" field on each record. Remember, the user in the "Hiring Manager" field must have the appropriate permissions to approve records. Hope this helps!

  • Eden

    Member
    May 16, 2023 at 3:26 am

    Hello Anjali,
    As per my experience, To achieve dynamic approval processes in Salesforce, you can use standard approval processes along with custom fields and formulas. For example, to create an approval process based on a hiring manager field on a position record, you can create custom fields and a formula that determines the approver based on the hiring manager field. You can then set up an approval process that triggers based on the custom fields, routing the record to the appropriate approver. To get trained on Salesforce Marketing Cloud, there are various resources available such as official Salesforce training courses, Trailhead modules, and online training providers. With (https://www.igmguru.com/course/salesforce-marketing-cloud-training/)[Salesforce Marketing Cloud training], you can learn how to use this tool to create and manage email and social media campaigns to connect with customers and grow your business.

    • This reply was modified 1 year, 7 months ago by  Eden.

Log In to reply.

Popular Salesforce Blogs