BPM to create custom Customer ID

Hi,

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?

Any help would be greatly appreciated.

Absolutely, or you could use GetNextSequence

https://www.epiusers.help/t/lets-share-useful-functions-sharing-is-caring/100371/23?u=klincecum

1 Like

Welcome to the party @jgee!

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.

3 Likes

Or ā€œMid South Extrusionā€
and ā€œMid South Lawn Careā€

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.

1 Like

Dude. You’re aging us.

@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.

3 Likes

Extra Bonus Points… what does the S & H stand for?

1 Like

image

Fastest Googler in the East

4 Likes

I forgot. My Mom also collected Plaid stamps as well.

1 Like

But did you know Sperry & Hutchinson began offering stamps to U.S. retailers in 1896?

I was just a baby…

1 Like

(I probably should have said, ā€œwithout using a search engineā€)… but winner!

1 Like

Yep, I got my first pack from the Great Atlantic and Pacific Tea Co.

Or at least I feel like I’m that old.

2 Likes

Sorry @jgee , I didn’t mean to completely hijack your thread! Hope you can use some of the ACTUAL answers to your question here…

2 Likes

Little Bit Netflix GIF by Blown Away

1 Like

It’s worth 25 stamps…

2 Likes