Creating an Alert for Outdated Opportunities in SugarCRM
The advanced workflow tool in SugarCRM known as Advanced Workflows enables admins to automate processes within organizations. This is the third blog post in our series: Creating Workflows in CRM.
A workflow that alerts users of outdated opportunities in your CRM keeps the opportunity data in your CRM up to date for forecasting, reporting, and management insight. This alert will prompt a sales rep to update the status or expected close date of every Opportunity as it passes it’s expected close date if it is still in an open status.
Step 1: Create Email Template
Before setting foot in Advanced Workflows, create the email you want to be sent out to users when an Opportunity is overdue. Consider what you want the email to say, how you want it to look, and what information from your CRM should be included.
First, navigate to the Process Email Templates module. Once there, you will view a list of existing email templates in a list view, like below.
Next, click on “Create” to begin building a new email template. A drawer will open so you can enter the name, target module, assigned to user, and description. Name the template “Overdue Opportunity Alert” or another descriptive name, and make the Target Module “Opportunities”. Once you’ve completed these fields, click “Save” to begin drafting the email template.
Once you click “Save”, you will see an empty email template, like in the screenshot below.
Fill in the subject line and the email content. If you want to add in any dynamic CRM fields, click the gear button on either the subject line field or in the toolbar on the email content field.
Check the boxes next to the fields you want to include in the email template. Common fields to include would be Opportunity Name, Opportunity Status, Expected Close Date, and Assigned To.
Once you click the blue “Done” button the fields will be inserted into the email body.
Once you are satisfied with your email template, click the blue “Save” button. Now your template should be ready to use in a workflow.
Step 2: Create Process Definition
To begin creating a new workflow, navigate to the module called Process Definitions. Click the blue “Create” button to begin the process.
A drawer will open up where you can add in basic information about the workflow.
First, choose the Target Module. The Target Module is the type of record you want to trigger the workflow. In this case, choose your Target Module to be Opportunities. Note–you can’t have a process definition that triggers from multiple modules–you would have to create separate workflows. Next, make sure the workflow is disabled. This prevents the workflow from triggering before you are done building it. Click “Save & Design”. Now you will see a blank design canvas, pictured below.
You will need to add five elements to the design canvas to build this workflow. Simply click on the events in the toolbar and drag them to the design canvas. Add one start event, one wait event, one exclusive gateway, and two end events.
Now you should rename each event icon in a descriptive way to help you understand what each event does. The names in the image below are good examples.
Once you have the five events added and renamed, you can begin connecting them using the crosshairs. Hover over the event until you see the crosshairs, then click and drag to connect the two events.
Once all five events are connected, it is best practice to right click on each event and adjust the settings. You may not need to always adjust settings on all of them, but it is thorough to check each. This is where you will set criteria for the workflow to run and the specific actions that will be triggered. Right click on the start event and select “Settings”.
A pop up window will open. Under the “applies to” dropdown, select the option for “new records only” since we want every Opportunity record created to be monitored. Click “Save”.
Next, right click on the wait event and click “Settings”.
This is where you will tell the workflow how long to wait before checking to see if the Opportunity is up to date. We want the workflow to check all Opportunities as they pass their expected close date. Select the radio button for “Fixed Date” and then set the criteria to be “Expected Close Date” plus one minute. To do this, select “Expected Close Date” under fields, a plus sign, and 1 minute under “Constants”. Click “Save”.
Next, right click on the gateway event and click “Settings”. Here we must set what criteria determine which path the workflow takes.
Set the first gateway criteria by clicking “Evaluation”, then choosing “Module Field Evaluation”, and then “<Opportunities>” from the dropdowns. Next, select the criteria to be: “Status is equal to Closed Won or Status is equal to Closed Lost”.
Set the second gateway criteria by clicking “Evaluation”, then choosing “Module Field Evaluation”, and then “<Opportunities>” from the drop downs. Next, select the criteria to be: “Status is equal to New or Status is equal to In Progress”.
Now we must adjust the settings on the two end events. Right click on the top end event and verify that the Result is “Do Nothing”.
Right click on the bottom end event and change the result from “Do Nothing” to “Send Message”.
Right click on the bottom end event again and go to “Settings”. From here, select the email template we created in step one. Next, indicate who you want the alert email to be sent to. If you have one person who is responsible for Tasks, you could just type in their email address. Usually, you will want to alert the person it is assigned to. To do this, select “user”, then click the bottom right drop down to select “is assigned to the record”.
You may also want to send the alert to the the user’s manager. To also CC the manager, Select “<Tasks>” and “User is manager of who is assigned to record”.
Click “Save”. Now you are done creating the process definition.
Step 3: Activate & Test
The last step is to go back to go back to the list view of Process Definitions and activate the definition we just created. From the list view, select the drop down arrow and click “Edit”. Change the workflow to be enabled. After it’s active, test that the workflow is setup correctly. Create a new Opportunity with an expected close date of yesterday and assign it to yourself. You should receive an email within a few minutes which would confirm your workflow works (see our test email below). If you didn’t, walk through these steps again and make sure you followed the instructions correctly. If something doesn’t make sense–comment below. We are happy to help!