CPQLESS
  • Home
  • Platform
    • Resources
    • Best Practices
  • Contact Us

Automate the Opportunity Name with a Flow

6/17/2025

 
This is one of the easiest to implement automations that has saved us from having to add a bunch of fields to a report.  

The idea here is that the name of the opportunity should never be manually filled in by anybody, it should be based on the details of the Opportunity.  When I learned about this process, it was such a time saver for everybody involved!  No more "Follow this format when entering your Opportunity Name" request from managers!  No more reps not following the process... it all just happens and saves a lot of brain cells from having to think what to name the opp.

So here's where it starts:  Create a record triggered flow whenever an Opportunity is created or updated.
The condition is when the Formula evaluates to true.  The formula is "1=1"

When to run the flow is everytime a record is updated and meets the condition requirements:
Picture
Next, you will add an Update Record Element and update the Name of the Opportunity using a Formula.  The formula will need to be a "New Resource" you build.  

Let's call the "New Resource" Formula "Update_Opp_ NameFormula" (its an api so you need underscores for spaces).

Next, you'll need to write the formula.  Formulas can get a bit tricky as you are going to pull in multiple elements from the Opp but for the first example I'll keep it real simple:

Formula:  
TRIM(LEFT( $Record.Account.Name,30)) + " | " + TEXT($Record.Amount)
End Formula

This will create the Opp Name that will look like this:  "Smith Company | 10000" which is great but doesn't convey much... you will want to add in the Opportunity Type, the Close Date.... etc...   So here's a more extreme example that pulls in the Record Type ID and some custom fields:

Formula:
/*New*/
If( $Record.RecordTypeId = "012f10000000LwqAAE",
TRIM(LEFT($Record.Account.Name,30)) + " | New Logo | " + TEXT($Record.Users__c) +" Users | " + TEXT($Record.Hours__c) +" Hours | $" + TEXT($Record.AARR__c) + " ARR | "
+ text(month($Record.CloseDate)) + "/"
+ text(year($Record.CloseDate)),
End Formula

So what the above will do is check the Record Type (this is for New Business) and the put the account name with the term New Logo and add in the number of Users and the number of creative hours with the ARR from the Opp and the Month and Year Close date so the Opp Name now looks like this:
Smith Company | New Logo | 15 Users | 10 Hours | $15600 ARR | 10/2025

And the rep never had to update or change it as it updated along with any other changes they made.  If they push the close date out, the date at the end auto updates.  It's just that easy!

Here's the formula I used for New Business, Upsell, Renewals... it's a lot of it saves the reps a ton of time and makes report reading easier as the Opportunity name tells a good part of the story now!

​/*New - Alternate Account Name*/
If( $Record.RecordTypeId = "012f10000000LwqAAE" && NOT(ISBLANK($Record.Alternate_Account_Name__c)),
TRIM(LEFT($Record.Alternate_Account_Name__c,30)) + " | New Logo | " + TEXT($Record.Users__c) +" Users | " + TEXT($Record.Hours__c) +" Hours | $" + TEXT( $Record.AARR__c ) + " ARR | "
+ text(month($Record.CloseDate)) + "/"
+ text(year($Record.CloseDate)),

/*New*/
If( $Record.RecordTypeId = "012f10000000LwqAAE",
TRIM(LEFT( $Record.Account.Name,30)) + " | New Logo | " + TEXT($Record.Users__c) +" Users | " + TEXT($Record.Hours__c) +" Hours | $" + TEXT($Record.AARR__c) + " ARR | "
+ text(month($Record.CloseDate)) + "/"
+ text(year($Record.CloseDate)),

/*Auto Renewal*/
If( $Record.RecordTypeId = "012f10000000LwvAAE" && $Record.Auto_Renewal__c = TRUE,
"AUTORENEW | " +TRIM(LEFT( $Record.Account.Name,30)) +" | " + TEXT($Record.Users__c) +" Users | " + TEXT( $Record.Current_Year_Term_Months__c ) +" Months | $" + TEXT($Record.AARR__c) + " ARR | End Date: "
+ text(month( {!$Record.Contract_End_Date__c} )) + "/"
+ text(year({!$Record.Contract_End_Date__c} )),

/*Renewal*/
If( $Record.RecordTypeId = "012f10000000LwvAAE",
TRIM(LEFT( $Record.Account.Name,30)) + " | Renewal | " + TEXT($Record.Users__c) +" Users | " + TEXT( $Record.Current_Year_Term_Months__c ) +" Months | $" + TEXT($Record.AARR__c) + " ARR | End Date: "
+ text(month( {!$Record.Contract_End_Date__c} )) + "/"
+ text(year({!$Record.Contract_End_Date__c} )),

/*Upsell - Alternate Account Name*/
IF( 
$Record.RecordTypeId = "0123Z000000PVnvQAG" && NOT(ISBLANK($Record.Alternate_Account_Name__c)),
TRIM(LEFT($Record.Alternate_Account_Name__c,30)) + " | Upsell | " + TEXT($Record.Users__c) +" Users | " + TEXT($Record.Hours__c) +" Hours | $" + TEXT( $Record.AARR__c ) + " ARR | $" + TEXT( $Record.One_Time__c ) + " One Time | "
+ text(month($Record.CloseDate)) + "/"
+ text(year($Record.CloseDate)),

/*Upsell*/
IF(
$Record.RecordTypeId = "0123Z000000PVnvQAG",
TRIM(LEFT( $Record.Account.Name,30)) + " | Upsell | " + TEXT($Record.Users__c) +" Users | " + TEXT($Record.Hours__c) +" Hours | $" + TEXT( $Record.AARR__c ) + " ARR | $" + TEXT( $Record.One_Time__c ) + " One Time | "
+ text(month($Record.CloseDate)) + "/" + text(year($Record.CloseDate)),
$Record.Name
))))))
So here's the update record step and the view of the flow:
Picture
While it looks complicated, it's actually quite easy and you and your team will grow to appreciate just how easy and time saving this is!

Account Validation Rules

6/17/2025

 
At several organizations I have been at, we had situations where Sales Reps would steal other Sales Reps accounts by reassigning them to themselves.  The tricky part of this is that in a larger organization, there can be instances where the Account should be reassigned or Reps work out a "trade" between each other regarding the account.

One way I deal with this is by creating a Validation Rule on the Account level that allows the Account Owner to be the only person able to change the Ownership of the Account.

Here's the Error Message first so it's easy to understand the definition of the rule:
"Only the Account Owner can change the Account Owner."

​Here's the formula:
ISCHANGED( OwnerId )
&&
PRIORVALUE( OwnerId ) <> $User.Id
&&
$Profile.Name = 'Sales Standard User'
End Formula


The above includes the edition of a profile name but you can write other options as part of this formula.  This simple validation rule has helped to reduce tracking ownership history and emails / messages to the team to change the account owner.  When asked to change the account, I typically just default to "Ask the Account Owner to switch it to you."  It gives autonomy to the Account Owners to manage their business and accounts.


Opportunity Validation Rules

6/17/2025

 
Here is a validation rule on the opportunity that is critical to making sure all opportunity close dates are current and up to date!  

I'll start with the error message so you can see the intent:
"Open Opportunities cannot have a Close Date in the past. Closed Opps cannot have a Close Date in the future. Please update your Close Date. Thanks!"

The goal here is to make sure that Close Dates are always current for open opps (meaning they can't be in the past!) and Closed Opps cannot have a Close Date in the future (you've seen it before, an Opp Closed Lost with a Close Date 2 months from now... that's just bad data integrity!  

Here's the rule to keep it clean!
Formula:
OR(

AND(
CloseDate < TODAY()- 3,
IsClosed <> TRUE
)
,
AND(
OR(
TEXT(StageName) = "Closed Lost",
TEXT(StageName) = "Closed WON"
),

CloseDate > Today()
)
)
End of Formula

Now, you'll notice that the rule is "CloseDate < TODAY()-3".  I did that to give some flexibility to the sales team as they might be working a deal and need to make changes or waiting for something on a Sunday and need an approval so I wanted to be a bit forgiving.

But otherwise this will work well to keep those Close Dates up to date as a Rep cannot save their Opp unless the Close Date is adjusted to meet the rules.


    Best Practices

    Just some ideas of things to do in your Salesforce

    Archives

    June 2025

    Categories

    All
    Flow
    Opportunity
    Validation Rules

    RSS Feed

Home | Platform | Pricing | Contact | Resources 
​Minneapolis, MN
  • Home
  • Platform
    • Resources
    • Best Practices
  • Contact Us