Skip to main content

Notifications

Announcements

No record found.

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?

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,848 Super User 2024 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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans