Automated policy number

0
I want policy number to an user “xxx-xxx-xxx” format and increment by 1 when every user created, can I do that
asked
1 answers
3

Hi,

 

You could:

 

  1. Create PolicyID field that is an auto number
  2. Add an “after create” event to calculate the PolicyNumber.
  3. Take the ID field, use Community Commons “String Left Pad” to turn the number to string with padded 0. With length 9… 1 → 000000001
  4. You can then do some string manipulation like this to add the “-” in the appropriate places:
    substring($str,0 , 3)+'-'+substring($str, 3, 6)+'-'+substring($str, 0, 3)+'-'+substring($str, 6, 9)

 

 

answered