Haven't deployed yet - need to delete customers

We have not deployed yet. Our deployment has been delayed. I have an issue where I need to remove ALL 60,000 or so customers from the Live environment, to be reimported via DMT after a lot of customer ID changes. I have no way of tracking which customer IDs have changed since the initial upload, so I want to remove all of them and redo it.

To complicate that, most of those customers have at least one serial number attached. I’d be happy just deleting all serial numbers and reuploading them, too. But of course, because SNTran records are created when a serial number is created, it’s impossible to delete them through normal means.

I’ve tried unassigning the customer ID from every serial number via DMT, and that did its job but Epicor still complains that the customer has a serial number when I try to delete it, presumably because activity still exists in the SNTran table.

Since we haven’t deployed yet, I’m thinking I might be able to get away with backing up the database and then removing the SNTran and SerialNo records from the database manually. But I understand that I don’t know enough about the schema to not mess it up. Is there also a PartTran record, for example (it doesn’t look like it–I can see in DBeaver that the table is empty)?

I’d like some advice, either on deleting customers or on deleting serial numbers. Perhaps an expert on the database schema can help me.

Thanks.

Edit: To be clear, I would be okay deleting ALL serial numbers currently in the database. We do not have any inventory in the system yet, it’s all been imported via DMT, status set to SHIPPED, and a customer assigned (now unassigned, which I see has created another set of transactions in SNTran).

Why not “Simply” change the customer ID? Epicor supports changing customer IDs while still retaining all the linked data because the true index is a “Customer NUMBER” which is typically hidden. I believe that you can change the ID using DMT. You would need to know the current customer number.

1 Like

Even if DMT has the capability (there’s no hint of in the program or any documentation I’ve seen), I won’t have records of the old customer IDs. They have already changed in our current CRM.

Oh, I see how it could be done with DMT, now. Point still stands that I can’t map to a CustNum without knowing the old CustID. It’d be a lot cleaner to delete everyone and start with a clean export from our current CRM.

I wouldn’t do anything in the backend. Do you have a backup before you did the serial numbers?

It might be worth restoring that, deleting the customers and then moving forward.

2 Likes

Chris:
For the record: If you know the old CustID you can use a BAQ to pull all customers and include the existing CustID and then use the ‘NewCustID’ DMT field to just update the CustID.
You said you had SN assignments, how did that happen? With the SN Assign or some other transactions? You sure you do not have any other links to the Customer, like Sales Orders, etc?

But if you don’t have the old CustID in your CRM, that’s a problem.
I agree with @Doug.C go back to a back up…

Another thought that came to mind but probably will not help you is the Customer Search Cross-Reference functionality.

1 Like

There must be some other reference. If you have access to SQL profiler you should be able to run it and perform a delete of the customer and you will be able to work out where the problematic value lies. It could be that there is a flag, similar to the “has been used” on the part that once you start transacting it is a pain to fix.

I have to agree with @Doug.C and @Rick_Bird that having backups during implementations is always useful, as well as trying your changes in a staging environment, before applying them to your Production database. I get it you will always come across unexpected situations.

1 Like

That happened by adding SN records via DMT and including the CustID field. These came from our current CRM. In addition to producing SerialNo records, I can see it produces a transaction of type MAINT in the SNTran table.

I’ll have to see what backups we have tomorrow. Thanks.

if you have your original import, i would think that it might be possible to build an excel vlookup table to cross reference the old/new by looking up the customer by Name+Addressline+City, which should find most if not all of them. (I used to be in the mailing list business, and we had to do a lot of de-duping).