Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Not Getting Po No value

(0) ShareShare
ReportReport
Posted on by 3,099

Hi

   I have below code . On basis of condition sometimes i have to get values in Purch Invoice Header . Sometimes from Purch Inv Line. Getting values of all variables in both cases , but getting PO NO value in 1 case only.

Variables are defined in Purch Invoice Header Data Item only.

When i define PO NO in Purch Invoice Header Data Item then i get value in Purch Invoice Header only.

When i define PO No in Purch Invoice Line then i get value in Purch Invoice Line only.

When i put message then it display PO NO value in both cases. Only not showing in Dataset generated.

Thanks

*This post is locked for comments

  • mmv Profile Picture
    11,469 on at
    RE: Not Getting Po No value

    Could you check by using a MESSAGE on the lines.  If the "PO No." are prompted correctly, you may try the below method:-

    https://medium.com/nareshwar-r/setdata-getdata-on-ssrs-reporting-on-dynamics-nav-121ac46cde6

  • jsshivalik Profile Picture
    3,099 on at
    RE: Not Getting Po No value

    Hi

     Only one because with same name 2 cannot be given. When i add in header then it print the Header Value not Lines Value. If i give in Lines then it prints LIne Value not Header Value.

    Problem is why other variables are working fine. They have been defined only at Header DataItem. How their values are coming.

  • mmv Profile Picture
    11,469 on at
    RE: Not Getting Po No value

    How many "PO No." you have in your "DataItem" and where it's placed?  "Purch. Inv. Header" or "Purch. Inv. Line"?

  • jsshivalik Profile Picture
    3,099 on at
    RE: Not Getting Po No value

    Hi

      Yes in Report Header. It is written as

    =First(Fields!PO_No_.Value, "DataSet_Result")

    Thanks

  • mmv Profile Picture
    11,469 on at
    RE: Not Getting Po No value

    Are you displaying the "PO No." on the Report -> Header?  If so, please share the expression entered on the Header.

  • jsshivalik Profile Picture
    3,099 on at
    RE: Not Getting Po No value

    Hi

      When i display message then it displays value. Why on report it is not printed or i checked in dataset also it is blank.

    If i add variable in Header then it displays value found in Header . If i add variabe in Line then it displays value found in line. Whereas all other variables work in both condition.

    Thanks

  • mmv Profile Picture
    11,469 on at
    RE: Not Getting Po No value

    If your code is on the "Purch. Inv. Line" - "OnAfterGetRecord" trigger, it should work correctly, provided there is data.

    You can go to the respective Invoice, click on the "Lines" - > "Item Receipt Lines", and check whether the Receipt Lines are displayed.

    Please share the code written on "Purch. Inv. Line" - "OnAfterGetRecord"

  • jsshivalik Profile Picture
    3,099 on at
    RE: Not Getting Po No value

    Hi

     When i print variable value "PO No" in Purch Inv Header then it shows value. When is display message in Purch Inv Line then it shows blank. Since it is global value it should not show value in Lines also . Other variable are showing

    Thanks

  • mmv Profile Picture
    11,469 on at
    RE: Not Getting Po No value

    You may write something like as below:-

    Purch. Inv. Header - OnAfterGetRecord()

    "PO No" := "Order No.";

    "PO Dt" := "Order Date";

    After this you have write another code to get the "Order No." and "Order Date" base on the related "Receipt No." and overwrite them onto "PO No" and "PO Dt";

    In order to get this, you may refer the code on the 139 "Posted Purch. Invoice Subform" -> Actions - "Item Receipt &Lines".  Once you follow that, you may get "Receipt No.", based on that Receipt No, you can get the "Order No." and "Order Date" from "Purch. Rcpt. Line" table.

    You have to use same code from "Item Receipt &Lines" on the "Purch. Inv. Line" - OnAfterGetRecord trigger too.

  • Suggested answer
    Suresh Kulla Profile Picture
    47,789 on at
    RE: Not Getting Po No value

    Is there any custom field with the same name (P.O No) in those tables ? Try to change the variable name to something different and try.

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 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…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans