web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to archive always the newest version of a purchase order?

(1) ShareShare
ReportReport
Posted on by 30

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 have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,305 Super User 2025 Season 2 on at
    RE: How to archive always the newest version of a purchase order?

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans