You need to sign in to do that
Don't have an account?
Nick D'Addario
Generate Unique Non-Random String?
Hi All,
I'm looking to generate a unique string for each account. The string will be a concatenation of the first four letters of the account name and then a couple other characters depending on the natrure of the account. The trouble I'm having is with the unique part. If a generated code matches an existing code, then I'd use the next character in the account name. If there is no next character, use a 1. If there is already a match with the appended 1, use 2 and so on.
Also, for some context, the code would be generated when a new opportunity is created.
Anyone have an idea on how I'd accomplish this?
Thanks,
Nick
I'm looking to generate a unique string for each account. The string will be a concatenation of the first four letters of the account name and then a couple other characters depending on the natrure of the account. The trouble I'm having is with the unique part. If a generated code matches an existing code, then I'd use the next character in the account name. If there is no next character, use a 1. If there is already a match with the appended 1, use 2 and so on.
Also, for some context, the code would be generated when a new opportunity is created.
Anyone have an idea on how I'd accomplish this?
Thanks,
Nick
Raj Vakati
You can try like this