web
You’re offline. This is a read only version of the page.
close
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

Populate grid with table method?

(0) ShareShare
ReportReport
Posted on by 45

Like the title says. I have a grid on a form tied to a form data source. To try and keep things tidy, I wrote a method on the table associated with the data source that takes a table as a parameter. The method wraps an exists join in a select statement. The intent is to get back only table rows that match the table parameter that is passed in.

How can this be done?

Thanks.

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    If I got you right you can use temporary table as a form data source and populate it only with data you want, here is an example https://stoneridgesoftware.com/using-tempdb-tables-in-ax-2012-forms/

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi jkmajcen,

    I'm not able to understand what you want to achieve. What is the business process you want to solve here? Can you provide some more concrete information? Where and how do you pass a table parameter. Is this based on an action of the user?

  • jkmajcen Profile Picture
    45 on at

    The functionality I'm building is a grid that can be filtered in a number of different ways with the purpose of creating a refined list from which the user can select individual rows of interest. The user then clicks a menu button that redirects to a dialog form. I'd like to essentially display the same style grid used to make the selections but only show the selections.

    I've had to put a pause on the project, but the strategy I left off on was to use the MultiSelectionHelper to load a temp table and then bind the grid to the temp table. Is there a better (more out of the box) way to do this?

    So I'm not sure that I'll be pursuing the implementation that prompted my initial question, but I'm still curious if a table method can be called from a data source and if so, can parameters be passed in to the table method. If you could do this, seems like it would be a clean way to get a filtered dataset back.

    public static UnitLine findProposedUnitLines(UnitLineProposal _selectedUnitLines)
    {
    UnitLine proposedUnitLines;

    select * from proposedUnitLines
    exists join proposedUnitLines where proposedUnitLines.InventTransId == _selectedUnitLines.InventTransId;

    return proposedUnitLines;
    }

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    If UnitLines is your grid data source, you can simply add a range to the form data source query.

    Please verify if you simply want to filter the grid by your criteria.

  • jkmajcen Profile Picture
    45 on at

    How would I apply that range? Add a range for each selected row?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Exactly.

    Here's how to add ranges to form datasource queries: www.google.com/.../

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 499 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans