Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Get all rows from the ...
Finance forum
Answered

Get all rows from the MarkupTrans table into a Grid in the PurchTotals form

Posted on by 107
Hello everyone,
I am a new developer in the X++ language and D365 Forms.
I am facing a problem, or rather, it seems to be an error due to my lack of knowledge in dealing with Forms. The problem, in short, is that I need to create a Grid inside the PurchTotals Form, and this Grid should retrieve data from the rows in the MarkupTrans table.
I have created an extension for the Form and have added a new data source where I've linked the MarkupTrans table. I have also retrieved the necessary fields. However, the data that is being displayed to me is not what I want in its entirety. I need to display all the rows in the MarkupTrans table, but the rows being displayed are the ones that appear in the /Accounts payable > Purchase orders > All purchase orders > Maintain charges/ interface. This means that it retrieves the rows that have been distributed on invoices.
I need a way to retrieve all the rows from this table without any restrictions or data filtering.

Thank you for giving me some of your time.
  • Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,532 Moderator on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    If issue is resolved, please mark helpful answers as verified so that it can help anyone in future facing same issue.
  • Suggested answer
    Ali AbdAlNasser Profile Picture
    Ali AbdAlNasser 107 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    Hello everyone,
    I would like to express my utmost appreciation for your cooperation and assistance in your attempts to solve the problem I mentioned in the question. As I mentioned before, I was facing an issue due to my lack of knowledge in working with the system, and my expectations were met after several attempts. I finally managed to identify the reason for my inability to retrieve the required data.
    The first reason: I was trying to fetch the data without using any joins, and that's why the rows I needed weren't appearing. The available rows are displayed in payable > Purchase orders > All purchase orders > Maintain charges.
    The second reason: I was using a join to fetch data from the MarkupTrans table using the Common data source, and this was preventing any data from being displayed. I believe the reason for this issue is the absence of matching data between the two tables.
    The solution: It seems that the solution was very simple. I needed to call the MarkupTable and perform a join from the MarkupTrans table to the MarkupTable, specifying the join type as InnerJoin. This way, the data will appear in the desired format.
     
    Thank you all, and I apologize for my lack of knowledge. Once again, I appreciate your valuable time.
    Best regards,
    Ali Abdul Nasser.
  • Ali AbdAlNasser Profile Picture
    Ali AbdAlNasser 107 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    Hello everyone!
    I would like to thank you all for your response and your attempts to help me solve my problem. I am extremely grateful for that.
    However, I believe it is preferable to change the approach to problem-solving as suggested by Mr. Bharani Preetham. His proposal is to create a temporary table and populate the data in it, and use it in a way that is not tied to the PurchTotals model.

    Thank you once again for your valuable time in listening to me, and I hope you will be able to assist me in implementing this suggestion.
  • Ali AbdAlNasser Profile Picture
    Ali AbdAlNasser 107 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    Hello Layan Jweihan,
    From this path, I open the PurchTotals form.
     
     
  • Ali AbdAlNasser Profile Picture
    Ali AbdAlNasser 107 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    Hello Waed Ayyad,
    I have tried all types of membership and none of them have worked.
  • Layan Jwei Profile Picture
    Layan Jwei 6,870 Super User 2024 Season 2 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    Hi Community member,

    Thanks for sharing the grid properties. May I ask how are you accessing this purchTotals form?
    is it from "all Purchase orders" then you click the button "Totals" or from where exactly? (if you can share full screenshot of the form please)

    Thanks,
    Layan Jweihan
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 5,090 Super User 2024 Season 2 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    The Hi Community member,

    Can you share the properties of the new Grid that you added?
     
    "If you activate the join, no rows will appear." ----- Did you try Outer join? 
     
     
    Thanks,
    Waed Ayyad
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,532 Moderator on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    How about showing data in a temp table instead of datasource addition? 
     
    If you need to add via datasource like how you did, in that case you need to debug the code and find how the data is rendered to the user. It can happen that somewhere the range might have been set to show only these values based on the Table where the common is being initialized.
  • Ali AbdAlNasser Profile Picture
    Ali AbdAlNasser 107 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    I understand the relationship between the two tables, but I don't want to execute a specific condition, which is the "Keep" condition. Currently, it retrieves rows that have a value of 1 and ignores rows that have a value of 0. I want to remove this condition.
     
    If you activate the join, no rows will appear.
     
    And here are the data being displayed.
  • Layan Jwei Profile Picture
    Layan Jwei 6,870 Super User 2024 Season 2 on at
    Get all rows from the MarkupTrans table into a Grid in the PurchTotals form
    Hi Community member,
     
    What are the properties of the datasource that you added to the form? ("join source" and "link type")

    Also i'm not sure why you said you want it without a relation. As there is a relation between MarkupTrans and Common based on tableId and recId
     

    Thanks,
    Layan Jweihan

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,142 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,979 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans