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
kalibazarkalibazar 

Use Picklist to create unique code

Hi all,

 

I have created a picklist with 5 sports (named "Sports"), I would like to use the sport I selected in the picklist to then be the start of a unique account code.

 

For example:

 

If I added an account for a cricket club I would want the club code to be CC/0001

For a hockey club I would want HH/0001

 

(where the 4 numbers are automatically assigned buy ascending order dependent on when the account was added)

 

Does that make sense? Not sure if I have explained it very well!!

 

Any help will be greatly appreciated

Best Answer chosen by Admin (Salesforce Developers) 
tantotanto

You will need to create a few items here:

 

  1. An auto number field
  2. A formula field that will use a Case function to convert Hocky to HH, Cricket to CC, etc
  3. A formula field that will combine item 1 and 2 into one field

All Answers

tantotanto

You will need to create a few items here:

 

  1. An auto number field
  2. A formula field that will use a Case function to convert Hocky to HH, Cricket to CC, etc
  3. A formula field that will combine item 1 and 2 into one field
This was selected as the best answer
kalibazarkalibazar

Fantastic, did what you suggested and it works a treat...now to work out how to put the unique sequential numbering that everyone is after in place!

tantotanto

Can you elaborate on that?

b-Forceb-Force

It Looks your requirement is similar to this one

 

http://boards.developerforce.com/t5/General-Development/Custom-Field-Formula-creation/m-p/207326#M46765

 

 

First I am expecting you are using Enterprise or Unlimited edition, This post contain full length trigger code

 

If it solve your issue , mark as accepted

Thanks,

Bala

Debbie CarrizalesDebbie Carrizales
i want a unique table for this sports blog : https://rugbyworldcupinsider.com/
hd ss 6hd ss 6
I'm also dealing with this extraordinary trouble in my dev surroundings. a few take a look at money owed are also affected to run specific program in CMS as you can see the detail (https://pickleballmate.com/best-pickleball-paddles-for-spin/). Please assist.