Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

how to sum the column without using calcsum in business central

Posted on by 148
Sum the Employee PF Withdraw column and after that subtract with total pf and stored in total provident fund but it doesnot work for more than two rows.
 
 qrytbl.Reset();
                qrytbl.SetRange(/CNIC NO../, rec.CNIC);
                pftbl.Reset();
                pftbl.SetRange(CNIC, rec.CNIC);
                if qrytbl.FindSet() then begin
                    if pftbl.FindSet() then begin
                        pftbl.SetFilter(CNIC, rec.CNIC);
                        if pftbl.Find('-') then begin
                            repeat
                                myint := pftbl./ Employee PF Withdraw / + / Employee PF Withdraw /;
                            // / Employee PF Withdraw / := Rec./ Employee PF Withdraw / + xRec./ Employee PF Withdraw /;
                            // myint := / Employee PF Withdraw /;
                            // pftbl.CalcFields(/ Employee PF Withdraw /);
                            // pftbl./ Employee PF Withdraw / += pftbl./ Employee PF Withdraw /; //+ rec./ Employee PF Withdraw /;
                            until pftbl.Next() > 0;
                        end;
                        // pftbl.CalcSums(/ Employee PF Withdraw /);
                        pftbl.CalcSums(/ Total PF /);
                        qrytbl.TotalProvidentFund := pftbl./ Total PF / - myInt;//((pftbl./ Employee PF Withdraw / - xRec./ Employee PF Withdraw /) +)
                        // qrytbl.Modify(true);
                        qrytbl.Modify();
                    end;
                    // end;

                end;

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans