Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Retrieve data from a table buffer who has already selected

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi everyone,

I created a temporary table and i used it as a form datasource. This is filled when opening the form by the init's method of the datasource.

From this form I've to open another form by clicking on a menu item button and I have to init this with some calculation based on the previous datasource.

Since my first datasource is already selected and the buffer is valued, I have not to select it again.

So, how can I retrieve data from the first datasource to fill the second one?

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieve data from a table buffer who has already selected

    Thanks everyone, I solved the problem by using Args.

  • Iulian Cordobin Profile Picture
    Iulian Cordobin 8,201 on at
    RE: Retrieve data from a table buffer who has already selected

    Yes, depending on the type of tempDb:

    To create

    a new instance link (populating data/copying reference) from one table instance

    variable to the other with Temporary type tables:

       For InMemory

            tables, by using the setTmpData() method

       For TempDB

            tables, the linkPhysicalTableInstance() method

            replaces the setTmpData() call.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Retrieve data from a table buffer who has already selected

    What Iulian said should work, but in AX 2012 you have to use the linkPhysicalTableInstance() method instead of setTmpData() if the table is an actual tmp table.

    www.axaptapedia.com/Temporary_tables

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,162 Super User 2025 Season 1 on at
    RE: Retrieve data from a table buffer who has already selected

    Hi Marco,

    The link provided by Raziq should help you. If the second form will be opened with a menu item button instead of a button (like described in the shared blog) , you can fill the DataSource property on the menu item button on the first form to specify the records passed with the Args automatically. On the second forn the coding to retrieve the record is then the same,

  • Suggested answer
    Iulian Cordobin Profile Picture
    Iulian Cordobin 8,201 on at
    RE: Retrieve data from a table buffer who has already selected

    You should declare another buffer of the same temporary table and set it with buffer2.setTmpData(buffer1), where buffer1 is the buffer you would be getting from the first form. There are multiple ways of sending the buffer, one is passing it in the args.record.

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,457 on at
    RE: Retrieve data from a table buffer who has already selected

    Hi marco,

    Args is the best option to go with.....

    Please follow this below link.

    mfmujahidmim.wordpress.com/.../

    If this post helps, please verify this solution.

    Thanks,

    Raziq

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans