Auto numbering field for objects
A
Andrew Langhammer
Can we have a mechanism that allows for a custom field in an object (such as an account number field in the company object) to automatically populate with a number one higher than the existing highest number in the existing records of that object when a record of that object type is created.
Failing a built-in field type, a workflow action that finds the highest value of a number field in a series of records for an object, and exposes that value to the workflow. Then a Math Operation could be used to fill the number field of the new record with a number, one index higher.
Or just a way to set the existing Find <object> action to expose a field to the workflow, rather than just setting the record as the record to be operated on.
Log In
A
Andrew Langhammer
Okay, for other people searching how to do this, here's a way to do it using custom values.
1) Create a custom number field as your auto-number field (e.g. Reference Number in Contact object)
2) Create a custom value populated with the next number you want to appear in your autonumber field. (e,g. Reference Number Index = 10000)
3) Create a workflow that triggers on whatever event requires a new number. (e,g. Contact Created trigger)
4) Set the auto-number field to the value of the custom value with an Update action. (e.g. Update Contact > Reference Number = Reference Number index)
5) Use a Math Operation action to increment the custom value by 1 (e.g. Reference Number Index = Reference Number Index + 1).