Skip to main content

Hi there!

 

We have a Previous Opportunity ID field on Opportunity level to connect deals with renewals. Was wondering if there's a way to automatically populate some fields for a renewal based on the existing Previous Opportunity ID using a process builder or a flow. The logic I was thinking of is the following - a process looks up a record based on previous opp id and inserts values from old record to a new opportunity.

For example:

Old.Contract end date -> New.Contract start date

 

Old.Amount - New.Amount = Renewal amount delta

 

etc.

 

Please let me know if you have any suggestions, thanks!
4 answers
  1. Oct 2, 2019, 1:55 PM
    Hi Bohdan,

     

    That is definitely possible(in fact it is one of the use cases salesforce calls out on trailhead) Check out the trailhead below to see how they tackle your use case.

     

    Trailhead (https://trailhead.salesforce.com/en/content/learn/modules/business_process_automation/business_process_automation_combined?trail_id=automate_business_processes)

     

    The basics are that you'll create an process builder that will decide when the flow runs(when users click a button/stage change/etc...) the process builder action will send over the ID of the record and the flow will do the rest.

     

    High level the flow should do this.

     

    1. Get Element - get the opportunity that contains the existing information

     

    2. Get element for each child object(contact roles/opplineitems)

     

    3. Assignment Element - This is where you do the translation(old end date = new start date)

     

    4. Create Element - This just create the record that we built in the last element

     

    5. Loop Element - Loop over a child object to clone them to the new opportunity

     

    6. Assignment - This is where you do that translation for the child object(opportunity id = the id of the record from the udpate element)

     

    7. Assignment - Add the loop variable to a collection varialbe outside the loop -> Close the loop

     

    8. Update - updates based on the collection variable from #7

     

    9. Optional - repeat 5-8 for each child object that needs to be cloned over.

     

    If you have any questions specifically about the set up please just let me know.  Flow is very powerful, but can be a little daunting at the start.

     

     
0/9000