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 :
Microsoft Dynamics AX (Archived)

Same datasource, double grid in the same form

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

I have a form with two grids and in these I have to show the same datasource, but the first one has to be filtered by a query instead than the second one who has to show the entire data.

The problem is that if I filter the first datasource, automatically the second will take the changes that I've made on the first one. So I tried to create another datasource that would be filled with the entire data of the existing one, but it doesn't work.

The exisiting datasource is based on a temporary table (InMemory) that is filled by a class.

Any help or tip?

Thanks

*This post is locked for comments

I have the same question (0)
  • Mariano Gracia Profile Picture
    on at

    Have you tried to clear dynalinks in the second datasource?, try to do it in the init method from the second data source

  • Community Member Profile Picture
    on at

    I doesn't work anyway. The second datasource appear to be filled with the records that are stored in the first datasource, but they are empty or set to 0 if numeric.

  • Mariano Gracia Profile Picture
    on at

    Click right mouse button in the form, select personalize and then go to the query tab, my be you find something else that can helps you to understant what is happening

  • Community Member Profile Picture
    on at

    Nothing that can give us information.

    I only need to retrieve the data stored in the first datasource and put it in the second one. I tried using a method "setTmpTable()" that while it select records from the first datasource it fills the fields in the second one with an easy insert() function. Unfortunately at the end it returns a series of empty records but of the exactly number that the first datasource stores.

  • Andrew Xu Profile Picture
    3,877 on at

    Hi Marco,

    could you be more specific on your requirement?

    You should be able to make it by using 2 separated data sources

  • Suggested answer
    Community Member Profile Picture
    on at

    I suggest that you should create two datasource in your form using same temporary table

    as you said that temporary table is filled by a class,

    so you should modify you class to fill two tables one from first datasource and other from second datasource

    now in you form create two grid using each datasource

    Please verify and update us if this is workable solution for your scenario

  • Mariano Gracia Profile Picture
    on at

    Nitesh is right, I didn't realize you were using the same datasource, you should use a second datasource, so each grid can be filtered in a different way

  • Community Member Profile Picture
    on at

    I was using already two datasource. Initially, as you said Nitesh, I used two datasource based on the same temporary table but the second datasource doesn't retrieve data like the first one does.

    So I tried to duplicate the temporary table to have two datasources with two different table, but in this case I the second table was filled by empty records but with the exaclty number of records that the first table contains.

    Now, I tried again using your tip, but it continues saying that the grid is empty.

  • dolee Profile Picture
    11,279 on at

    Hi Marco,

    I don't know how your implementation is like currently. Instead, I'd suggest you try a quick test like this:

    1) Create a new form with 2 datasources (not linked). You can use CustTable and name them CustTable1 and CustTable2

    2) Add code to the form to initialize both datasource as temporary tables and fills in different set of data. e.g.

       CustTable cSource;

       int j;

       CustTAble1.setTmp();

       CustTable2.setTmp();

       while select cSource

       {

             j++;

             if (j mod 2 == 0)

             {

                    // Insert data to CustTable1.

             }

             if (j mod 3 == 0)

             {

                    // Insert data to CustTable2

             }

       }

    3) Finally, add 2 grids in the form. Make sure one set to reference CustTable1, and the other set to reference CustTable2.

    This should produce the result you looking for.

  • Community Member Profile Picture
    on at

    Thanks for reply Dominic, but I've already tried with that procedure and it doesn't give good results, unfortunately the situation is always the same.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans