
Hi guys,
I would like to find out who adjusted an order again later and possibly what was done there.
Now I have thought of the archive and would like to push again and again the new version (thus also the change) into the archive.
In the page 54 Purchase Order Subform I have written in the OnInsertRecord trigger code that pushes the current document into the archive using the codeunit 5063 ArchiveManagement and the function StorePurchDocument.
This also works so far.
However, if a document has never been archived, after changing my order (change 1) I do not get the last status of the order in the archive, but the original status (original).
If I then create a new order line (change 2), then the order is also archived again, but with my previous changes (change 1). Not with the latest (change 2)?!
Am I using the wrong trigger? Should I do it better in the table?
I think if you just want to know the modification history of the purchase order, it would be better to use the Change Log feature.
More details: https://learn.microsoft.com/en-us/dynamics-nav-app/across-log-changes
https://learn.microsoft.com/en-us/dynamics-nav-app/across-log-changes
If you insist on using your solution, you can also add your code to the OnInsertRecord trigger code on the Purchase Order (50, Document) to ensure that the order has been archived. But I personally think this is not the best solution.
Hope this helps.
Thanks
ZHU