Change log for Order Misc Charges?

Does anyone know if there is a change log available for Misc Charges? (on the order header or line items). I have been tasked with creating one. They want a history of all adds/deletes/changes to these entries.

Thanks

Have you looked at the OrderMsc table? It already has ChangeBy and ChangedDate & Time columns. Should be able to set up a DD / Changelog against that table to track changes?

Deletes may be an issue, but you could potentially write a BPM that writes the pertinent info to the ChgLog table to store that as well?? Not sure if that’s doable or not.

Hi, yes the OrderMsc and OHOrderMsc tables contain the data but they want to know if an entry has been changed and what the change was (or what it was changed from - to).

I am trying my hand at a BPM method directive on SalesOrder.Update but I am having a hard time getting the original value (before it is changed).

Correct, so create a Data Directive on OrderMsc, pick which fields you want to track in the Change Log:

I can then see the changes in Order Entry’s ChangeLog:

image

Click into that entry and see what changed (assuming they were changes to the fields you pre-selected in the DD).

The log text details the before & after state of each field that was changed.

Can also query against the ChgLog table and see the record is added there:

image

2 Likes

From what I’ve read on some previous posts, tracking record deletions is hit or miss (mostly miss) and chglog records also often get purged with the source record is deleted from its table. (example, deleting an order line may result in all chglog rows detailing previous changes to that order line getting whacked).

So… if you need to track deletions, you may need to test to verify the behavior and potentially get creative, perhaps a BPM to write all chglog records for a deleted record over to a UD table prior to the deletion actually taking place. Not sure on that one. More homework to do on my part.

2 Likes

Thank you! I will check it out.

1 Like

OK well I think I finished this project. It seems to be working but I’ll have to hammer some more data in to make sure it is correctly doing what we want. As I said above we wanted a history of adds, deletes and updates to miscellaneous charges - both on the order header and order line items. We used to do this with a trigger on OrderMsc back when we were ON PREM! But alas now we are in the cloud so it’s harder.

This was more tricky because you have inserts/deletes/updates from OHOrderMsc and OrderMsc so there is a lot of branching. I am (or was) pretty new at BPMs so I had to start real basic and build it up using lots of messages showing the interim data. I used the SalesOrder.Update method and a pre and post directive. The pre processing directive sets most of the call context variables. The post feeds them into the UD03.Update method several ways.

I am wondering if this is usually how people build these things - there is a ton of widgets, so no code really. It seems to work though.

Some sample misc charges on the order header:

More misc charges on the line item:

The Pre processing directive:

The Post:

And the results from a BAQ:

Anyways, just thought I would follow up and show how I did it.

2 Likes