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
JaxBeachDevJaxBeachDev 

How do I limit a field update to a certain record type?

Hi,

I have a formula that updates my opportunity name field

(Account.Name & " - " & TEXT(Category__c) &" - " & TEXT(Qty__c) & " - $"& TEXT(Amount))


This is the default for all opportunity names.  It works great on direct sales.

For opps that go through distribution, the sales reps don't want to see the distributor name (account name field) in the opportunity name so I need to create a different formula for

If it is an indirect opportunity record types = $RecordType.Name = "Domestic Indirect"

 

Then

 

(End_User_Agency__c & " - " & TEXT(Category__c) &" - " & TEXT(Qty__c) & " - $"& TEXT(Amount))

 

if Not, then

 

(Account.Name & " - " & TEXT(Category__c) &" - " & TEXT(Qty__c) & " - $"& TEXT(Amount))

Best Answer chosen by Admin (Salesforce Developers) 
goabhigogoabhigo

You have posted the answer already !!

 

I guess you are updating the opportunity name using workflow field update. If yes, try this:

 

IF( $RecordType.Name = 'Domestic Indirect',

 End_User_Agency__c & " - " & TEXT(Category__c) &" - " & TEXT(Qty__c) & " - $"& TEXT(Amount),

 Account.Name & " - " & TEXT(Category__c) &" - " & TEXT(Qty__c) & " - $"& TEXT(Amount)

)

 

Let me know whether this helped in solving the problem.

All Answers

goabhigogoabhigo

You have posted the answer already !!

 

I guess you are updating the opportunity name using workflow field update. If yes, try this:

 

IF( $RecordType.Name = 'Domestic Indirect',

 End_User_Agency__c & " - " & TEXT(Category__c) &" - " & TEXT(Qty__c) & " - $"& TEXT(Amount),

 Account.Name & " - " & TEXT(Category__c) &" - " & TEXT(Qty__c) & " - $"& TEXT(Amount)

)

 

Let me know whether this helped in solving the problem.

This was selected as the best answer
JaxBeachDevJaxBeachDev

Thanks it worked great - I knew what I wanted, just wasn't sure on the syntax.  Thanks so much :-)

goabhigogoabhigo

My pleasure buddy..