A new knowledge base article has been published on our support portal.
Scenario Overview
In this business scenario the requirement is to generate an Auto-Number on the Account entity. The specific requirement is that the first 3 characters of the account name is used as a prefix and that when generating the AutoNumber we need to count the number of existing prefix records & increment by one.
Below is an example of what we require,
Account Names
Microsoft – Ireland
Microsoft – UK
Microsoft – USA
Microsoft – Canada
Account Numbers
MIC-0001
MIC-0002
MIC-0003
MIC-0004
Note1:
As always whenever we are using the North52 Auto-Number formula type we are guaranteed consistency when generating Auto-Numbers so no duplicates will be created even with multiple application servers for any of CRM Online, OnPremise or Partner Hosted.
Note2:
It is assumed that the ‘Account Number’ field is read-only, accounts are never deleted (only deactivated) & users cannot change the field.
N52 Formula Manager Solution
The Formula Manager solution works like this,
- Execute on the create of Accounts within the system
- Have a formula that generates the auto number requirements
- This formula executes a fetch-xml query passing in the prefix to get the existing count & adds one
- Have the formula place the result of the formula into the Account Number field of the Account entity