Yes this is possible with a script. It is also possible without a script.
Given the two examples you have, it looks like each customer is a combination of a parent company and a location. You want the name of the parent company and an increment number. In the table of parent companies, have a field with the {Highest Number}. Have a formula field for the {Next Number} that adds one to this number.
When there is a record for a new location of the parent company, have an automation create the {Unique Customer ID} by copying over the name of the parent company and the {Next Number} to the new location record. Also copy over the {Next Number} to the {Highest Number} in the parent company record.
If you create new location records faster than the automation can run, you may have problems with multiple locations getting the same increment number, but that is an issue with automation speed and would apply to any system based on automations.
Yes this is possible with a script. It is also possible without a script.
Given the two examples you have, it looks like each customer is a combination of a parent company and a location. You want the name of the parent company and an increment number. In the table of parent companies, have a field with the {Highest Number}. Have a formula field for the {Next Number} that adds one to this number.
When there is a record for a new location of the parent company, have an automation create the {Unique Customer ID} by copying over the name of the parent company and the {Next Number} to the new location record. Also copy over the {Next Number} to the {Highest Number} in the parent company record.
If you create new location records faster than the automation can run, you may have problems with multiple locations getting the same increment number, but that is an issue with automation speed and would apply to any system based on automations.
Thank you for taking the time to reply @kuovonne
I think I follow and will try it out. The companies are not necessarily related. Maybe a bad example.
Could have "British Automotive Limited" and "British Construction", nothing to do with each other just begin with "British". So automotive would be BRI001, Construction BRI002 and a third organisation of "Bright Windows" would be BRI003
Would that still work on your design?
Thanks again
Mike
So you want to take the first three letters of the company name? This could still be done with automations, but it would require either multiple automations (to account for creating the records with the first three letters of the company name), or scripting, or a third party automation service.
On the other hand, I generally do not find unique record ids created with this format to be worth the hassle.
Agree but customer requirement (long story). Easy isn SQLServer. Thanks for the pointers