I am new to Epicor and still learning the ropes, so I am not sure if what I am asking is simple or massively complicated.
I want to create a BPM that will set the Customer ID field based on a set of rules.
I want the customer ID field to consist of the first three letters of the customer name and two numbers. These two numbers will be sequential from the previous customer where the first three letters match.
So if we had customer Epicor Systems Limited and they already exist in our system they would have customer ID āEPI01ā.
We then add a new customer, Epicor Systems Inc, I would want the BPM to set the customer field to EPI02.
I think I can figure out how to get the the first three letters of the customer name, but can I run a query on all existing customers where their ID starts EPI and return only one record which is the most recent and extract the number in a BPM?
The specific example you ask isnāt that big a deal, there are probably examples of code here on the forum that can help you out (search for āconsecutive IDā or similar).
The issue is probably going to be when a new customer has a name like āS & H Green Stampsā where there are spaces and special characters.
As @Ernie commented thereās some good posts on here already, hereās two you could try as a start:
We did this a few years ago in E10 using an In-Transaction data directive on the Customer table, and it allows for spaces, special characters etc (format is AAA111, so similar to yours) but I suspect there is a better way of doing it in Kinetic (Functions?) so Iāll let you investigate first, but happy to share more nothing else you find quite fits.
@jgee, one thing you will have in your favor with Kinetic, is that you can change the Customer ID anytime you like (same with suppliers). The only time the Customer ID and Supplier ID are fixed is with Multi-Company when referring to sibling companies. Often, you might see companies who run Kinetic use one Customer ID for prospects and suspects (customer type) and then get assigned a ārealā ID once then become customers.
I also worked at a company that did this naming convention (except three characters and three digits). Companies do change their names, so the IDs can be updated later if need. LIke Barry said, this is doable. It doesnāt have to be done right away either. Personally, Iād write a function to do it and then be able to call it from a BPM, a button, or another scheduled function.