Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Getting calculated fields value in NAV

Posted on by 100

Hi there

I get a record of type VendorLedgerEntry this way:

VendorLedgerEntry.GET(2278);

The Record has a column "Amount" of type FlowField and has a CalcFormula like SUM(.....)

The retrieved Record assigned to VendorLedgerEntry variable has no Value in the column "Amount", the return value es '0'

Can I execute the CalcFormula after obtain the Record? or... Can I obtain the record with the field filled with the calculation result value?

Thanks everyone!

Pablo from Paraguay

*This post is locked for comments

  • Thanh Profile Picture
    Thanh 5 on at
    RE: Getting calculated fields value in NAV

    Thanks. Very helpful. ^_^

  • PabloRpy Profile Picture
    PabloRpy 100 on at
    RE: Getting calculated fields value in NAV

    Roberto, it works!

    I'm very grateful for your help!

    A hug from Py.

  • Verified answer
    Roberto Stefanetti Profile Picture
    Roberto Stefanetti 12,998 on at
    RE: Getting calculated fields value in NAV

    hi,

    you need calculate flowfields to get calculate values.

    example

    Codeunit 50001 TestCalcfields

    Local Variables

    recVendorLedgerEntry record Vendor Ledger Entry

    OnRun()

    recVendorLedgerEntry.GET(2551);    --> obtain record (GET is like FIND on primary key)

    MESSAGE('Amount : ' + FORMAT(recVendorLedgerEntry.Amount));

    --> Result 0

    recVendorLedgerEntry.CALCFIELDS(Amount);  --> calculate flowfield

    recVendorLedgerEntry.CALCFIELDS(Remaining Amt. (LCY)) etc. etc.  --> calculate flowfield

    MESSAGE('Amount : ' + FORMAT(recVendorLedgerEntry.Amount));

    --> Result "Amount value" > ex. 50.240

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans