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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

show data in grid from SalesTable and PurchTable

(0) ShareShare
ReportReport
Posted on by

I need to show sales orders and purchase orders in the same grid on a form.

The columns on the grid will be similar fields from SalesTable and PurchTable (Eg: Order#, Mode of delivery, Delivery Terms, Carrier etc)

There will be a check box next to the order#. User will pick what ever orders they want by clicking the check box. User will then click a button to process those orders.

I can not join SalesTable and PurchTable and have them as form datasource. (Our data for Sales orders and purchase orders are not inter company orders and are not related. Sales orders and purchase orders are seperate orders)

Should i create a tempTable and use that as the form data source and load the sales orders and purchase orders into the tempTable?

I also need to filter which sales orders and purchase orders show on the form.

any ideas? thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Yes, using a temporary table is a viable solution. Nevertheless you could also create a union query, which would be better from performance perspective.

  • Community Member Profile Picture
    on at

    Create a view using union query  as @Martin Says.

    this is a guide.

    msdn.microsoft.com/.../cc605991.aspx

  • Community Member Profile Picture
    on at

    thanks Martin. I thought of union query but msdn documentation says that with union query, records can not be updated, data can not be sorted on second data source etc.

    will i be able to get the datasource of the selected records and do the update, sorting etc.

    please let me know if there is a existing Form in AX 2009 that i can use as example or if there is a link that has a example. thanks

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    You didn't say anything about updating these records directly in the grid, therefore I obviously couldn't know about such a requirement. If this is a must, you have to use the other suggested solution.

    Sorting works on union queries, you just have to add ranges to the first data source.

  • dolee Profile Picture
    11,279 on at

    Hi,

    I understand this goes against your original requirement, but wouldn't a multi-tabbed form easier to use?  (One tab shows PO, and the other show SO.)

  • Hariharans87 Profile Picture
    36 on at

    I am not sure about AX 2009. For sorting and filtering, you can use view. If it is simple status update based on the marked records then you can update in the process button code side.

    Please explain me detail about your update process.

  • Community Member Profile Picture
    on at

    the records do not have to be updated directly on the grid.

    I need to show sales orders and purchase orders in the same grid on a form.

    The columns on the grid will be similar fields from SalesTable and PurchTable (Eg: Order#, Mode of delivery, Delivery Terms, Carrier etc)

    There will be a check box next to the order#. User will pick what ever orders they want by clicking the check box. User will then click a button to process those orders.

    So, i need to loop through the records that have been selected by clicking the check box and update those records in SalesTable and PurchTable.

    will i be able to get the datasource of the selected records, so that i can update those records when the process button is clicked?

    I also need to filter and sort the records that i want to show in the grid.

    should i go with union query or tempTable?

  • Verified answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    In that case, my first reply is still completely valid - both options are possible.

    Choose what makes better sense for your specific scenario, taking into account all requirements and restrictions.

  • Community Member Profile Picture
    on at

    thanks a lot Martin. I appreciate your ideas.

    I have 6 fields that are common from Sales and Purch for which union query will work. But I also have 10 fields that would have different data for Sales and Purch.

    I don't want to have 10 display fields on the grid.

    I am thinking of going with tempTable.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans