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.
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.
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?
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.
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)
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.
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).
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.
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.
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.