Auto Numbering - Customer ID


(Chai Chang) #1

Being new to Epicor, there are some areas where when you create a new record, it does not auto generate the ID. Anyone have any samples, they can share? Will probably be using this for auto generating part numbers as well.

We would like our customer to start with “C000001”. Would like it to increment automatically, so next one would be “C000002”. Let say if “C000005” already exists, it would increment until the next number is available. Any examples is greatly appreciated.


(Andy Wilson) #2

Hi, This is quite old but there are some notes on here for E10

AndyHow to Auto Assign Customer E10.pdf (346.1 KB)


(Mark Wonsil) #3

Good post by @AndyGHA. Also note that standard Epicor provides a cool feature that allows the user to change Customer IDs (and Supplier IDs) at anytime. Epicor uses an internal number as the key field (CustNum, VendNum). So if you don’t care about being consecutive, you could just pre-pend a “C” to the existing CustNum already in the database.

Mark W.


(Chai Chang) #4

Thank you. I will take a look at the post. Thanks.


(Chai Chang) #5

AndyGHA,

I am following your example. Your second directive method “Customer.Update”, I cannot find that in Epicor 10.2. Is it under a different method ID?


(Chai Chang) #6

Nevermind. I found it now due to search option limited to 100 records.


(Chai Chang) #7

Do you have any tips if a number already exists to automatically increment? For example, I created “C000006”. I then went and manually create “C000007”. If I use your code, it indicate that “C000007” already exists, when I want it to increment to “C000008”. Any ideas?


(Ken Nash) #8

you can update it manually to the starting number.

If you are using the User Codes method.


(Chai Chang) #9

I can manually update. I was more concern with users running into this issue, and I may not available to manually update the “Description” field with the new number. Just wondering if there’s a way to detect the error message and keep looping until no issue/error message.


(Tim Shoemaker) #10

It has been fun seeing the document that i published YEARS ago roll around the internet on how to auto-assign customer/supplier/project ID. I made it to be public for that reason… but it has gone under many iterations.
Method 1: I “invented” 25 years ago was to create a phoney customer ID called “Next”… and in the customer record, I bumped the number… but that method is bad because you always had to “hide” this phony customer.
Method 2 (I borrowed from someone) was to put a UD Field in the Company table, and have a BPM update that… I really didn’t like the idea of constantly editing the company table.
Method 3: I saw someone had used a UD01 table to store the data in. I never implemented this, nor did i like it because it tied up an entire table.
Method 4: I realized that we now had UDCode table, which is a “Table of tables”… you could have a UDCode called “Next” and then entries for each next entry you wanted “Customer” “Supplier”,etc… This is the prior method I always recommended and was used many times in both E9 and E10.
Method 5: the LATEST iteration uses a little known built in ICE function that can create and store a “Next” ID of your choosing.
Attached is the latest version of the document. Have fun.How to Auto Assign Customer E10 using ICE Next number.pdf (868.7 KB)


Intelligent customer ID thread
BPM | Prevent Duplicates with Multiple Criteria
Increment Customer Name
(Chai Chang) #11

Thank you Tim. That is awesome. I will take a look at the latest iteration and see. The method 4 was what I had used and seems to work well. Only issue is if we DMT Part, Customer, or Vendor, I would have to update that next gen number to avoid issue with duplicate ID. Not sure if the ICE function will run into similar issue, but will take a look.


(Tim Shoemaker) #12

correct… if importing previously assigned numbers, then you would need to update the “next” number so that it would not conflict…
BUT (I HAVEN"T TESTED YET)… you might find that if you put “AutoAssign” into the customer ID in your DMT Template, that the BPMs will fire and still auto assign. BPMs do fire even when using DMT, so it MIGHT work. (Let me know what you find).


(Chai Chang) #13

Interesting with the “AutoAssign” and DMT kicking off the BPM. That would be neat if that works, but will update if it does work when I test it.


(Chai Chang) #14

Tim,

Any ideas with this error about NextValue? I changed this for Supplier.


(Tim Shoemaker) #15

Hmmm… what version are you on? It looks like the command might be different in your version… The version I wrote this for only has two parameters (The code, and the command), but the error message is asking for an IceContext… not sure. image


(Chai Chang) #16

I am on 10.2.100.7.


(Jonathan Lang) #17

Did this ever get resolved? Any one else get this error?


(Joe DeWitt) #18

Is there a problem with this approach in 10.2.x? Good to know before i implement this approach. We move to 10.2 next year.
@timshuwy


(Mark Wonsil) #19

Hey Joe,

What is the business reason for auto-numbering the Customer ID? The Customer ID can be changed after written? Certainly it’s not sorting. Inter-company requires the company ID for the Customer ID but I can’t think of a good reason anymore other than the momentum of a previous system.

Mark W.


(Joe DeWitt) #20

Hey Mark,

99.9% of our BPM’s and processes in Epicor were written by my predecessors. I have made it may goal to evaluate 1 BPM (and form customizations) a week for improvement or remove it if it is no longer necessary. I am finding many that are broke, can be removed, or the code is painfully ugly.
In this case i am up to the BPM and sets the next customer Id. We already auto-number our customer ID’s. It is using Method 2 mentioned by Tim above. It seemed kind of quirky so i searched e10 for any updated method and found this thread. I want to give method 5 a try but not if there are issues already known with 10.2.