web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to show Warehouse field data on Purchase requisition SSRS report D365FO

(2) ShareShare
ReportReport
Posted on by 406
Hello guys,
 
i need to get the data in the warehouse field to show on the purchase requisition report. but im facing some challenges with the mapping it because of the relation. the field name is InventLocationId and table is InventDim.
anyone can provide me the correct relation to i can implement it in my DP Class?
thanks
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,874 Most Valuable Professional on at
    Open PurchReqLine table in the designer, expand Relations node and find the relation called InventDim. In some cases, you can simply use the this relation (e.g. by calling relations(true) on a QueryBuildDataSource object) or you can look at the relation definition to know which fields you need in code.
  • D365FO DEV Profile Picture
    406 on at
    hi @martin drab,
     
    can   you provide me the correct code?
  • Martin Dráb Profile Picture
    239,874 Most Valuable Professional on at
    I can't, because what code you should write (if any at at all) depends on how you've implemented (or are going to implement) your report or how it's implemented the report you're extending. You may be modifying an AOT query, use the query framework, write a select statement in X++, use electronic report and so on. There is no universal code.
     
    If you have no idea how to design the code, you'll need to tell us more about your report.
  • D365FO DEV Profile Picture
    406 on at
    hi @martin drab,
    ive used the relation in the lines table:
    select InventLocationId from PurchReqLine where PurchReqLine.InventDimId == InventDim.inventDimId
                                            && PurchReqLine.InventDimIdDataArea == InventDim.dataAreaId;
    headerFooterTmp.WarehourseLocation = PurchReqLine .InventLocationId;
     
    but its coming null.
    note that my code is in an inserting event handler that is an extension of standard dp class.
  • Martin Dráb Profile Picture
    239,874 Most Valuable Professional on at
    Your code makes no sense to me. You asked for getting inventory dimensions for a requisition line, while your code assumes that you already know the dimensions and you find the first requisition line that happen to be using this set of dimensions. That's clearly wrong. Also, you wanted InventDim.InventLocationId but you're selecting PurchReqLine.InventLocationId instead.
    Another bug is that you're assigning information about the line to the header.
  • Suggested answer
    Saran S Profile Picture
    333 on at
    Hi,
    If you have a record in purchReqLine, you need to retrieve the corresponding InventDim table record using the details from the purchReqLine record.
    Try this,
     
    select inventDim where inventDim.inventDimId == purchReqLine.InventDimId && inventDim.dataAreaId == purchReqLine.InventDimIdDataArea;
    headerTable.Warehouse = inventDim.InventLocationId;
     
    Is your question answered? If yes, then please verify the answers that helped.

    Thanks.
  • D365FO DEV Profile Picture
    406 on at
    Hi saran,
     
    i've tried ur code, the relation is not retreiving records and its null. the data is not being fatched after i debugged the code
  • Martin Dráb Profile Picture
    239,874 Most Valuable Professional on at
    Please use the debugger to find more information about what the code does.
     
    Is there a value in purchReqLine.InventDimId field? Is InventDimIdDataArea the same as the company where the code executes? It's currently not a cross-company query, therefore it won't work if it's from a different company.
  • D365FO DEV Profile Picture
    406 on at
    Hi Martin,
     
    if you check this screenshot, all the fields values are coming blank, even that some of them have data on the system.
  • Martin Dráb Profile Picture
    239,874 Most Valuable Professional on at
    Then there is no surprise that you don't find any InventDim record if you have no InventDimId to start with. It seems that you failed to populate purchReqLine variable and therefore all the subsequent code have no data to work with. Forget all the code from your screenshort for now, because the problem is elsewhere. Debug the code where you (should) set a value to purchReqLine 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 461 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 428

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans