Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to save data in Temporary DataItem

(0) ShareShare
ReportReport
Posted on by 3,051

Hi

   How to save data in temporary Dataitem in a report and then display information in a Tablix

Purchase Invoice Header

Purchase Invoice Line

In Purchase Invoice Line i have below code


Purch. Inv. Line - OnAfterGetRecord()
PLine.RESET;
PLine.SETRANGE(PWHRLine."Source No.", "Purch. Inv. Line"."Purchase Order No.");
PLine.SETRANGE(PWHRLine."Source Line No.","Purch. Inv. Line"."Purchase Order Line No.");
IF PLine.FINDFIRST THEN BEGIN
  RNo := PLine."RNo";
  RDate  := PLine."RDate";
END;

RNo , RDate i want to display in separate Tablix

Thanks

*This post is locked for comments

  • Suggested answer
    Dilanka H. Profile Picture
    Dilanka H. 116 on at
    RE: How to save data in Temporary DataItem

    Hi jsshivalik,

    I see a compilation error in this code which you have mentioned in your question.

    PLine.SETRANGE(PWHRLine."Source No.", "Purch. Inv. Line"."Purchase Order No.");
    PLine.SETRANGE(PWHRLine."Source Line No.","Purch. Inv. Line"."Purchase Order Line No.");

    You cannot use a setrange field to a reference where outside of the referred dataitem. In this case the red colored Field name should be inside the PLine dataitem (record variable), assuming that PWHRLine is not a recordset of Table Puch. Inv. Line.

    And to answer to your question, why exactly do you need to get support from Integer Virtual Table loop? I assume that, only one Warehouse Receipt Line must be there with respect to the filtered Purchase Order Line No which you tried to setrange in the first place. So there must be only one iteration per one single Purchase Inv. Line, considered. 

    If in your case may there be more than one Whse. Rec. Lines per one Purch. Inv. Line, let me know I'll summit that for you without going for an Integer Table (which speeds up your report).

  • jsshivalik Profile Picture
    jsshivalik 3,051 on at
    RE: How to save data in Temporary DataItem

    Hi

      I am storing in array . How to iterate using integer table i want to know that.

    Thanks

  • Suggested answer
    Zaid Tariq Profile Picture
    Zaid Tariq 2,270 on at
    RE: How to save data in Temporary DataItem

    Hi,

    RNo , RDate should be array and then iterate them using integer table. Thanks

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans