function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JRB_8JRB_8 

Need to strip off hyphen (-) in Opp name on convert

I'm having trouble with a field update formula that would strip off the hyphen that is added to the end of the new opportunity name when a lead is converted.  Is it standard for a hyphen to be appended to the Opp name during the convert process?

Best Answer chosen by Admin (Salesforce Developers) 
MandyKoolMandyKool

Hi,

 

You can set up your workflow rule as follows.



Entry Criteria - Only when record is created.

 

IF 

CONTAINS(Name,'-'),true,false 
)

 

Field Update -

 

SUBSTITUTE( Name , '-', '')

 

By default the salesforce allows you to add the name which starts with Account Name -. So that user can edit that name and use some other name (Generally ppl use Account Name-Opportunity Name)


 

All Answers

MandyKoolMandyKool

Hi,

 

You can set up your workflow rule as follows.



Entry Criteria - Only when record is created.

 

IF 

CONTAINS(Name,'-'),true,false 
)

 

Field Update -

 

SUBSTITUTE( Name , '-', '')

 

By default the salesforce allows you to add the name which starts with Account Name -. So that user can edit that name and use some other name (Generally ppl use Account Name-Opportunity Name)


 

This was selected as the best answer
JRB_8JRB_8

Thanks, works great!

Karyna do MonteKaryna do Monte
Thanks!
Steven RainesSteven Raines
The official knowledge article is here (https://help.salesforce.com/articleView?id=000332234&type=1&mode=1), but the logic is flawed.  The current logic will remove all hyphens from the opportunity name.  To only remove the appended hyphen use the following rule and update formula.

Use Rule:

IF(RIGHT(Name, 1) = '-', true, false)

Specify New Field Value as below:

LEFT(Name, LEN(Name)-1)