Best way to automate creation of renewal opportunity and associated quote?

Hello all - new to Sugar automation. 

We have a manual opportunity renewal process that we have been following for a number of years.  Essentially, we go to the previous Closed Won opportunity and copy it, manually edit all of the necessary fields, and re-create the associated quote from scratch.  This process typically takes a few minutes per opportunity x's hundreds of opportunities each month.  Looking for a way to partially automate this process.  I reviewed the Renewals/Sales Console, and unfortunately, I don't think it will meet our needs.

I have been experimenting with Action Buttons and SugarBPM.  I created an Action Button on our Opportunities layout that successfully creates a new opportunity based on the previous Closed Won opportunity and automatically updates all of the necessary fields; however, I couldn't find a way to also copy over the associated quote from the previous Closed Won opportunity - at least not using an Action Button or triggering a SugarBPM process.  I then pivoted to creating another Action Button on the Quotes module (resulting in a 2-step process), so that our users could first go to the previous Closed Won opportunity, click the new Renew Opp Action Button to create the new renewal opportunity, then go back into the quote from the previous Closed Won opportunity and click the Renew Quote Action button to create the new renewal quote, but I hit a wall when trying to associated the newly created renewal quote with the newly created renewal opportunity.  I tried setting the Opportunity Name field in the Quotes module accordingly, but this did not work, presumably because this is a Relationship field.

Any recommendations on how best to proceed?

Thanks!

Parents
  • I am interested in seeing what others suggest.

    I use a custom scheduler that queries Opportunities that are up for renewal and creates and links the Beans using BeanFactory; the scheduler runs every month and creates what I need 90dd before expiration.

    In terms of linking your Opportunity and Quote, the Opportunity is a Relate field, not a Relationship (subtle but important difference) on the Quote so you are half-way there, you need to populate both the name and the id of the Opportunity on the quote:

    $quoteBean->opportunity_name = $opportunityBean->name;
    
    $quoteBean->opportunity_id = $opportunityBean->id;

    I find that looking at the vardefs in the cache folder is the easiest way to find our if it's a relate or relationship and, in the case of relationships, the link name.

    For example in:  cache/modules/Quotes/Quotevardefs.php

        'opportunity_name' =>
        array (
          'name' => 'opportunity_name',
          'rname' => 'name',
          'id_name' => 'opportunity_id',
          'vname' => 'LBL_OPPORTUNITY_NAME',
          'type' => 'relate',
          'table' => 'Opportunities',
          'isnull' => 'true',
          'module' => 'Opportunities',
          'link' => 'opportunities',
          'source' => 'non-db',
          'len' => 50,
        ),
        'opportunity_id' =>
        array (
          'name' => 'opportunity_id',
          'type' => 'relate',
          'source' => 'non-db',
          'rname' => 'id',
          'id_name' => 'id',
          'vname' => 'LBL_OPPORTUNITY_ID',
          'table' => 'opportunities',
          'module' => 'Opportunities',
          'link' => 'opportunities',
          'massupdate' => false,
        ),
    

    FrancescaS

  • Hi Doug,

    In addition to Francesca's response, I’d like to share my thoughts. Since you are not able to achieve everything through the action button and the two-step process you’ve followed feels cumbersome, I have a suggestion. You could create a custom button using code on the Opportunity record view and perform an API call. In the custom code, you can handle the creation of the Opportunity and Quote and manage everything in one place. This way, you only need to click once, and your custom code will handle everything in the backend.

    I understand that custom coding requires time and effort, and people generally prefer not to implement customisations when feasible solutions like action buttons are available. However, this approach could simplify the process significantly.

    Thanks and Regards,

    Ramya Katram,

    www.bhea.com

Reply
  • Hi Doug,

    In addition to Francesca's response, I’d like to share my thoughts. Since you are not able to achieve everything through the action button and the two-step process you’ve followed feels cumbersome, I have a suggestion. You could create a custom button using code on the Opportunity record view and perform an API call. In the custom code, you can handle the creation of the Opportunity and Quote and manage everything in one place. This way, you only need to click once, and your custom code will handle everything in the backend.

    I understand that custom coding requires time and effort, and people generally prefer not to implement customisations when feasible solutions like action buttons are available. However, this approach could simplify the process significantly.

    Thanks and Regards,

    Ramya Katram,

    www.bhea.com

Children
No Data