How do I make sure that all my Opportunity records include the Account name to keep naming consistent across all records?
|Knowledge Article Number||000213662|
|Description||I would like to enforce a consistent naming standard for opportunities. The opportunity name for any opportunity should include the associated Account Name.
How can I make this happen?
|Resolution||You would need to create a workflow rule to evaluate all opportunity names based on the formula you specify. If the name does not include the associated account name, it will be added.
First we'll create the workflow rule, then define the immediate actions.
1. Create a new workflow rule.
a. Click Setup | Create | Workflow & Approvals | Workflow Rules.
b. Click "New Rule" button.
c. Select the Opportunity object. Click "Next".
d. Enter the name and description, then select "created, and any time it’s edited to subsequently meet criteria" as evaluation criteria.
e. Under Rule Criteria, select "Run this rule if the following" and choose formula evaluates to true.
f. Add the following formula to the formula field:
g. Click "Check Syntax" to ensure there were no mistakes, then click "Save & Next".
2. Add an immediate workflow action to update the Opportunity Name field when an opportunity meets the above criteria.
a. Click "Add Workflow Action" and select "New Field Update" option.
b. Define the workflow field update by providing the Name and Description and selecting the "Field to Update". In this case, select "Opportunity Name".
c. Under Text Options, select "Use a formula to set the new value" and specify the following formula:
Account.Name & ": " & Name
d. Click "Save".
3. Return to the Workflow Rule detail page and click "Activate" to activate the rule.
Side note: There's one corner case where this won't work as expected. If you change the Account associated to the Opportunity both the old and the new names would be added, as the criteria will match. In that case you can manually edit the Opportunity Name and remove the old Account Name from it.