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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Calculate Age in calculated field/flow field

(0) ShareShare
ReportReport
Posted on by

Hi all,

I am thinking how can I get an "Age" field display in the page and make sure the age will change date by date. I think sth like flow field is good but cannot find suitable function. Can anyone suggest? Thanks!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    The requirement you have is not clear. Do you want a field (Age) that is automatically updated when opening a page? If so, you can create a flowfield or maybe a function that calculates the Age for the current record. Then on the page place a field with SourceExpression = your function and trigger the function calculation in OnAfterGetRecord.

  • Verified answer
    Zaid Tariq Profile Picture
    2,274 on at

    Hi,

    Can you please elaborate a bit about what you mean by suitable function? I guess the simple formula is your DBO - TODAY and you will have the age. From development perspective you can use Age := DATE2DMY(TODAY, 3) - DATE2DMY(DOB,3)  but it will compare will give you number of years difference. This is very simple and basic logic but if you want exactly correct calculating you need to write some code.

    forum.mibuso.com/.../calculate-difference-between-two-dates

    Let me know if you still have any query. Thanks

  • Community Member Profile Picture
    on at

    Thanks Stefano, just notice I can customize like this.

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans