Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Calculate Age in calculated field/flow field

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculate Age in calculated field/flow field

    Thanks Stefano, just notice I can customize like this.

  • Verified answer
    Zaid Tariq Profile Picture
    Zaid Tariq 2,266 on at
    RE: Calculate Age in calculated field/flow field

    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

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Calculate Age in calculated field/flow field

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans