Using Workflows to Automatically Update the Account’s Type When an Opportunity is Won

    Overview

    Sales users must manage their opportunities as well as keep account details diligently updated. Some account details can be inferred from other records or behaviors in Sugar to help with maintaining accurate account data. In this article, we will automatically manage the account type based on whether or not a sale is made. If the account type is set to “Prospect” and a related opportunity is changed to the “Closed Won” stage, a workflow will update the account’s type to “Customer”.

    Beginning with version 9.1.0, each user’s license type (e.g. Sugar Serve) determines what functionality is available as described in the User Management documentation. The Workflow module used in this article is not available in Sugar Serve and Sugar Sell. 

    Prerequisites 

    • To create a workflow triggered by an opportunity, you must have administrator or developer-level access to the Opportunities module.
    • Schedulers, specifically the Process Workflow Tasks scheduler, must be running.

    For more information, please refer to the User Management, Role Management, and Schedulers documentation.

    Steps to Complete

    Although this workflow will be affecting account records, the trigger event will be performed within the Opportunities module. Follow these steps to create a workflow triggered by a specific change to an opportunity’s sales stage that then modifies a related account record.

    1. Navigate to Admin > Workflow Management.
    2. From the Workflow Management actions menu, select “Create Workflow Definition”.
    3. Complete the form fields as follows and then click “Save”.
      • Name : Change account type to customer 
      • Execution Occurs : When Record Saved
      • Status : Active
      • Target Module : Opportunities
      • Applies to : New and Updated Records
      • Processing Order : Alerts then Actions
      • Description : When an Opportunity is saved with stage Closed Won, change the account type to Customer.
    4. Click “Create” on the Conditions subpanel to configure the first condition. This condition will specify that the opportunity’s sales stage must change to “Closed Won”.
      • Choose “When a field in the target module changes to or from a specified value” and then click the hyperlinked text “field”.
        • In the popup window, select the field “Sales Stage” and then click “Save”.
        • When returned to the previous window, click “Next”.
      • Click the hyperlinked text “value”.
        • In the popup window, select “Is” and “Closed Won” from the dropdown menus. Click “Save”.
        • When returned to the previous window, click “Save” again.
    5. Click “Create” on the Conditions subpanel to configure the second condition. This condition will specify that the opportunity’s parent account’s Type field is not already set to “Customer”.
      • Choose “When the target module changes and a field in a related module contains a specified value” and then click the hyperlinked text “module”.
        • In the popup window, select the module “Accounts” and then click “Save”.
        • When returned to the previous window, click “Next”.
      • Click the hyperlinked text “specific field”.
        • In the popup window, select “Type” for the field and “Does Not Equal” and “Customer” from the remaining dropdown menus.
        • Click “Save”.
        • When returned to the previous window, click “Save” again.
    6. Next, create an Action that will update the account type to Customer.
      • Click “Create” in the Actions subpanel.
      • Select “Update fields in a related module” and then click on the hyperlinked word “record”.
        • In the popup window, select the module “Accounts” and then click “Save”.
        • When returned to the previous window, click “Next”.
      • Select “Modify the field: Type”.
      • Click on the hyperlinked word “Type” and in the resulting pop-up window, set Type as “Customer” and then click “Save”.
      • Click “Save” again to complete the workflow.

    This workflow is now ready to use. When a user wins an opportunity, Sugar will check the related account and, if needed, set its type to “Customer”.

    in Workflows

    Reach out to us for help