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 :
Small and medium business | Business Central, N...
Answered

difference between SETAUTOCALCFIELD and CALCFIELD

(0) ShareShare
ReportReport
Posted on by 125

HI,

I learnt SETAUTOCALCFIELD is automatically calculate the flow field and CALCFIELD is to calculate the flow field.

what is the main difference between SETAUTOCALCFIELD and CALCFIELD?.

I have the same question (0)
  • Suggested answer
    Amit Baru Profile Picture
    3,035 on at
    RE: difference between SETAUTOCALCFIELD and CALCFIELD

    Hi,

    Adding Link for more clarity.

    https://docs.microsoft.com/en-us/dynamics-nav/setautocalcfields-function--record-

    https://docs.microsoft.com/en-us/dynamics-nav/calcfields-function--record-

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Suggested answer
    YUN ZHU Profile Picture
    90,276 Super User 2025 Season 2 on at
    RE: difference between SETAUTOCALCFIELD and CALCFIELD

    Hi, Just a performance difference.

    Hope the following helps.

    https://businesscentralgeek.com/7-tips-for-performance-business-central

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,613 Moderator on at
    RE: difference between SETAUTOCALCFIELD and CALCFIELD

    Hi Arepaka Sai ,

    Adding more information. I think it will help you understand more technically.

    I changed the CALCFIELDS to a SETAUTOCALCFIELDS in the OnPreDataItem. The results were impressive: the report now needed about 300 MB extra on the server side and finished in 5 minutes.

    Source : www.kauffmann.nl/.../

    Thanks.

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,050 Super User 2025 Season 2 on at
    RE: difference between SETAUTOCALCFIELD and CALCFIELD

    Calcfield only calculates the flowfield for current record.

    SetAutoCalcfield calculates the flowfield for all records that you retrieve. When you call SetAutoCalcfield before you retrieve the records, then when you use find and next, the flowfield values are automatically calculated. Using SetAutoCalcField is better performance than calling Calcfield in a loop.

    ------------

    Calcfield Example:

    if Rec.FindSet() then

    repeat

    Rec.CalcFields(Balance);

    //Do Something

    until Rec.Next() = 0;

    ------------

    SetAutoCalcfield Example:

    Rec.SetAutoCalcfield(Balance);

    if Rec.FindSet() then

    repeat

    //Do Something

    until Rec.Next() = 0;

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,710

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,675 Super User 2025 Season 2

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans