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 :
Microsoft Dynamics NAV (Archived)

get lastmodifieddate/time of a record

(0) ShareShare
ReportReport
Posted on by 32,729

hi all,

is there a way to get the timestamp or the lastmodifieddate/time of a record without creating a new datetime field for that issue and changing the onmodify-trigger?

*This post is locked for comments

I have the same question (0)
  • 4BzSoftware Profile Picture
    6,073 on at
    RE: get lastmodifieddate/time of a record

    Hi Jonathan,

    How about Change Log?

  • keoma Profile Picture
    32,729 on at
    RE: get lastmodifieddate/time of a record

    how can i activate/use that? i need it on record base.

  • Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: get lastmodifieddate/time of a record

    Here is link

    www.archerpoint.com/.../setting-change-logs-microsoft-dynamics-nav-2013

    msdn.microsoft.com/.../hh169208(v=nav.71).aspx

  • keoma Profile Picture
    32,729 on at
    RE: get lastmodifieddate/time of a record

    hi,

    thx for the hints.

    i tried it, but i does not help in that case.

    the problem is the following:

    an error occurs, when executing modify on PO-Line.

    the error message is: there was a try to change an old version of a record of type PO-Line. the record must be reloaded.

    so no record change is logged to the change log.

    my idea was to get the lastmodified datetime during execution (before commit was executed and any data is written to the database).

  • Suggested answer
    Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: get lastmodifieddate/time of a record

    Is that error message because of activating change log?

    Are there any customizations?

    I don't think just because of activating change log as it is standard feature and used by me/more lot of times.

  • Jens Glathe Profile Picture
    6,092 on at
    RE: get lastmodifieddate/time of a record

    Hi Jonathan,

    that's something completely different (TM) ;) You will get this when something / somebody has changed and committed your record after you've read it. If it is not a heavy-use scenario, and you're more or less alone in your development database, then something is odd with your code. :) You can easily trip into this with form/page triggers interacting with other things, like code in the table or codeunits. It is amazing how many commits there are in standard NAV alone.

    Do you have the offending code lines and surrounding, maybe we can help?

    with best regards

    Jens

  • keoma Profile Picture
    32,729 on at
    RE: get lastmodifieddate/time of a record

    hi mohana,

    thx for your friendly answer and yes, there is a plenty of customization. i discussed the point with my colleagues. it seems,  there are 2 modify statements applied on the same record at 2 times and a change between the 2 modifys, what causes that strange error.

    i started to debug, but it's hard to find out, what causes the error (the first modify, which changes the record before the second modify).

    my first attempt to get a modified datetime at runtime did not work.

  • Suggested answer
    Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: get lastmodifieddate/time of a record

    this error should occur ever if you enable/disable change log, right?

    may be you can comment one o those modify statements and check whether the logic is working fine or not and you can concentrate on design later?

  • keoma Profile Picture
    32,729 on at
    RE: get lastmodifieddate/time of a record

    hi mohana,

    yes the error occurs always. does not matter, if change log is enabled/disabled.

    the main problem is to find the first modify call. the error occurs with the second modify. setting a breakpoint into the onmodify-trigger did not help, so it seems, it's a modify(false) call.

  • Verified answer
    Mohana Yadav Profile Picture
    60,969 Super User 2025 Season 2 on at
    RE: get lastmodifieddate/time of a record

    ok. do you mean you don't know where the first modify code is written?

    and you are searching for it?

    I thought you are aware of both codes..

    May be you can use Code coverage tools and check

    www.mibuso.com/dlinfo.asp

    http://blogs.msdn.com/b/german_nav_developer/archive/2012/08/26/pimp-your-nav-2013-code-coverage-in-30-minuten-nachr-252-sten.aspx

     

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans