Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Adding values from fields

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to add the values together from the 'Amount' fields in each of my purchase lines.

How do I do this?

Thanks!

*This post is locked for comments

  • Verified answer
    Mohana Yadav Profile Picture
    60,232 Super User 2025 Season 1 on at
    RE: Adding values from fields

    make it

    ReceivedNotInvoiced := ReceivedNotInvoiced + PurchaseLine."Amount";

    and

    IF ReceivedNotInvoiced  <> 0 then

     MESSAGE('My Received Not Invoiced Amount is %1.',ReceivedNotInvoiced);

  • Community Member Profile Picture
    on at
    RE: Adding values from fields

    Hi Mohana,

    Thanks for replying.

    Thats pretty much what I have:

    IF PurchaseLine.FINDSET THEN

       REPEAT

         ReceivedNotInvoiced := PurchaseLine."Amount";

       UNTIL PurchaseLine.NEXT = 0;

     MESSAGE('My Received Not Invoiced Amount is %1.',ReceivedNotInvoiced);

    Will this work?

  • Suggested answer
    Mohana Yadav Profile Picture
    60,232 Super User 2025 Season 1 on at
    RE: Adding values from fields

    where do you want to do it?

    if it is in codeunits etc then I would declare a Purchase Line record variable and loop through all the records as per the requirement and calculate in a global decimal variable.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans