Auto Numbering based on Prefixes?

Posted by Rollbase User on 23-Jun-2011 15:52

I need a field on a record to be automatically filled with a unique value based on the user entering a prefix in the field and when the record is saved... a sequential number is appended to the prefix. For example: First record entered... User Enters "CIV" into the field... on Save the value is stored as "CIV-00001" Second Record Entered: User Enters "CRM" into the field... on Save the value is stored as "CRM-00001" Second Record Entered: User Enters "CIV" into the field... on Save the value is stored as "CIV-00002" Thanks

All Replies

Posted by Admin on 23-Jun-2011 16:17

Easy solution would be to have one auto-number field with single set of numbers and prepend that number with suffix.



If you want to have different sets of numbers for different prefixes you can use company-wide settings to store next IDs and combine these IDs with prefix in formula. I did not do that but it worth to try.



May be other guys on the forum have better ideas.

Posted by Admin on 23-Jun-2011 16:46

Actually the problem can be solved with Object Script triggers. Please create:

1. Picklist (drop-down) with values "CIV", "CRM" etc.

2. Numeric field (do not add it to any page)



After that submit support request and I'll help you to write Object Script to finish solution.

Posted by Admin on 23-Jun-2011 17:40

OK... I did what you suggested above. I await further instructions :-)

Posted by Admin on 23-Jun-2011 18:53

Please submit Support request now.

This thread is closed