You need to sign in to do that
Don't have an account?
Bh_5
3 digit Identifier [0-9][A-Z][A-Z] for Salesforce Record
Hello Everyone,
Need help on generating 3 char Identifier for Salesforce Record in below format :
[0-9][A-Z][A-Z]
e.g. 0AA,0AB,0AC....0AZ,0BA,0BB........9ZZ
Do we have library methods to generate such combinations ?
If not Please help in implementing the algorithm to generate 3 char Identifier for each of the records.
Need help on generating 3 char Identifier for Salesforce Record in below format :
[0-9][A-Z][A-Z]
e.g. 0AA,0AB,0AC....0AZ,0BA,0BB........9ZZ
Do we have library methods to generate such combinations ?
If not Please help in implementing the algorithm to generate 3 char Identifier for each of the records.
https://stackoverflow.com/questions/16822034/java-library-for-character-sequence-generator
Though above link is not for APEX but it exactly provides solution to me
Bhanu
All Answers
the variable lens is the desired length of the string generated.
It is possible that it may return the only number. You can add the extra condition that aftre random string generation check that it contains atleast one string otherwise again generate it.
but their could be scenarios where the returned value from above statement could be duplicate and then i have to additionally query the records to check if its been set on any record.
Can't we have in the sequence [0-9][A-Z][A-Z]
e.g. 0AA,0AB,0AC....0AZ,0BA,0BB........9ZZ
Could you tell me the use case what you are trying to achieve so that I can suggest any alternatives?
I hope this will help you,
Regards
Shubham
https://stackoverflow.com/questions/16822034/java-library-for-character-sequence-generator
Though above link is not for APEX but it exactly provides solution to me
Bhanu