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
amsteramster 

Formula Field Dependent On Record Type

Hello -
 
My company has 11 opportunity record types based on the 11 product services we sell. Each product has a fixed product ID. I would like to create a field that automatically populates with the product ID based on opportunity record type for that record. Is a formula field the best option for setting this up and what would the formula look like.
 
Product and ID examples
 
ISDN = 001
VPN = 002
 
Any advice would be much appreciated.
MSheridanMSheridan
Do you have access to workflow rules? If not a formula would work fine but you'll need to stay within the 1,300 character limit.
MSheridanMSheridan

If you create your Product ID field as a formula, you could use the CASE function to achieve the result you are looking for. It would look something like this:

CASE( $RecordType.Name, "Your record type name here", "Product ID", "Your record type name", "Product ID",......else result)

Let me know if this works for you.

APKAPK
You can just use a Field Update.  We've done this with a similar situation.
 
If opportunity record type equals "1", then custom product field is automatically updated to equal whatever you specify for that record type.