How to log record deletions?

Some deletions are really important for us to log in a changelog(or equivalent), as an example if someone deletes a pricelist we would sure like to know this especially if it was done in error and we’re trying to figure out why we’re selling a product for the wrong price.

How do others handle this?

1 Like

I have used BPMs to prevent deletion of records that can be inactivated/voided. This forces the user to deactivate/void instead…

You’ll need a custom BPM. We’ve got several that log and prevent changes.

1 Like

My understanding was that Epicor was rolling out Change Data Capture which handles recording deletes.

You can see all of the cdc schema tables in the db and even the screens in Epicor but I wasn’t able to get it to actually do anything yet. I assume that it’s going to roll out with 10.2.600 but the only list of new features that I’ve seen is from Encompass

I know Epicor Collaborate is going to use CDC but does anyone know how Multi-region Multi-company Cloud Transactions is going to work?

2 Likes

Hi Eddie,
You need to add a BPM Data Directive that intercepts RowMod = D records and store the deleted record info into either a UD table, or on the Change Log table “ChgLog” table of Epicor. Just check all the fields and how it works when you add a BPM DD Change Log for the Add and Update and you will figure it out.

Hope that helps
Best Regards,
PSE

5 Likes

Looking forward to this!

@Rich Riley will know as he heads up the Cloud Team.

1 Like

Multi-Region Multi-Company is the existing Multi-Company functionality but between different instances of ERP 10.

The instances still need to be at the same Release Version but they can exist in different data centers or even a Cloud instance and an on-premise.

Am I missing something? I want to log changes to supervisor time punch edits, which works fine when editing. But if the time punch is deleted, it deletes the record from the changelog as well…? It is fine if they want to delete the punch, but I’d like the change log record to stay.

EDIT

This was incorrect →
The change log record will stay, it just won't have any record to link to.
I am unsure if the last entry for the change log record will record the deletion.

I’m not sure what I was looking at before, I swear I made deletions and they were still
there, but I just ran a test to verify, and they are gone.

Sorry for the confusion.

Hi Terry,

Yes, indeed, when you delete the record all its logs will be deleted as well. That’s why you have to add your own Delete Change Log bpm, to keep track of what was deleted. Standard ChgLog functionality is meant to be used from the screen where the main record is managed (i.e. Customer Entry, Tracker), if the customer was deleted, how can you launch the Change Log Viewer? Of course, from a BAQ, Dashboard, etc.

Well, just add a BPM method directive Pre-Processing on the Delete method of your BO. Get all Ice.ChgLog for that Key1,Key2 and make a copy (in a UD table?) before they get physically deleted. If the deletion fails, not sure if applicable, then delete the copied records.

At the end, and assuming you implemented your own Delete ChgLog directive (original post topic), you will end up with a single record in the Ice.ChgLog table tracking the Delete event, and its history on a separate UD table (where you moved the previous events). I guess you could also re-insert them on the Ice.ChgLog table after Deletion… make some testing on your test environment :slight_smile:

Carlos
PSE

Oh so you’re copying data from the deleted record to a UD table (via custom BPM).
Then you’re assigning a data directive to that UD table to log changes to it. This adds records to the changelog, using standard/automatic epicor functions. Am I understanding correctly?

Any reason I can’t just add a change log record directly via BPM? The record will be orphaned I suppose; is that an issue? And yes I’d still need a BAQ to see them.

No, I think that is correct after all.

Here is an example. This is my own dashboard of the change log (so that I can search anything, even by user ID).

  • On Feb 14, one person used the duplicate action to make a new part record. This also has the effect of duplicating existing revisions of the old part.
  • At some later unknown time, rev A was deleted
  • On Feb 22, rev A was a new record (again)

But in that interstitial time, I don’t know what you can see. Maybe yes with a BAQ, but no with the UI?

You forget to read the edit ? :rofl:

Been there for an hour or so…

Well, I never read the original…

So, I read this:

image

And I am saying no, it is not not correct. :wink: The record does stay after a delete. You just have no record saying “I was deleted.”

Anyway, I think we agree.

Yes my original was the highlighted text in it’s entirety.
I just came back and corrected it.

Wait, what?

Now I’m really confused.

I said it stayed.
He said it didn’t.
I ran a test.
Record was gone from change log table.
I made correction.
You say it’s still there.

WHAT IS IT?!!!

Oy.

OK, point is this, in my pic, rev A (and altMethod = ‘’) is a “new record” twice.

So… logically it was deleted in the middle, right?

I cleared an entire UD table.
All my change logs for that are gone.

Yes, Yes it is.

I’m picking up what you’re putting down, but I wouldn’t want to rely on it :slight_smile: