Skip to main content

Notifications

Announcements

No record found.

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 404
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
  • Martin Dráb Profile Picture
    233,025 Most Valuable Professional on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    I can't write code for you because you tell us so little about your report. As I understand, you have some parameter or a query in your report that you want to use find a PurchReqLine and you have some unknown code for it, which doesn't work. So... what is the parameter or the query and what is your current code?
  • D365FO DEV Profile Picture
    404 on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    Hi Martin,
     
    based on my case, can you provide me with the correct code to implement it so i can retreive the warehouse field to show on my report.
    thanks
  • Martin Dráb Profile Picture
    233,025 Most Valuable Professional on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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.
  • D365FO DEV Profile Picture
    404 on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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
    233,025 Most Valuable Professional on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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
    404 on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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
  • Suggested answer
    Saran S Profile Picture
    195 on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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.
  • Martin Dráb Profile Picture
    233,025 Most Valuable Professional on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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.
  • D365FO DEV Profile Picture
    404 on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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
    233,025 Most Valuable Professional on at
    How to show Warehouse field data on Purchase requisition SSRS report D365FO
    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.

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,312 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,025 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans