Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Temporary table as form data source

(0) ShareShare
ReportReport
Posted on by

I have a form which should display data in the grid based on certain parameters. The grid has a temporary table as its data source.

Please see the image below:

212121.JPG


Now, I have used the linkPhysicalTableInstance( tempTable::populateTable(parm1, parm2)) on the clicked event of OK button. The records are getting inserted into the temporary table but are not getting displayed on the form.

Any idea about this?

*This post is locked for comments

  • Faisal Raja Profile Picture
    10 on at
    RE: Temporary table as form data source

    Hi Rohan,

    I have exactly the same requirement and I get the same error which you mentioned while clicking the button. Could you please tell me the way to resolve the issue ?

    Thanks in advance.

  • Community Member Profile Picture
    on at
    RE: Temporary table as form data source

    It works now. Thank you so much Martin.

  • Verified answer
    Martin Dráb Profile Picture
    232,860 Most Valuable Professional on at
    RE: Temporary table as form data source

    That's what I tried to do by "If you need to put data to the table after the form has been initialized, pass a reference to the buffer to your populateTable() method." You need to use the buffer created for you datasource.

    In populateData(), write records to the datasource buffer you receive as the parameter.

  • Community Member Profile Picture
    on at
    RE: Temporary table as form data source

    Oh. I did not realize that.

    Could you kindly help me out in resolving that error?

  • Martin Dráb Profile Picture
    232,860 Most Valuable Professional on at
    RE: Temporary table as form data source

    If you populate a new buffer that has nothing to do with the form datasource, how could the data magically appear on the form?

  • Community Member Profile Picture
    on at
    RE: Temporary table as form data source

    Hi Martin,

    I got the error initially when I used the 1st code, so I declared a temporary table buffer and used it. The error was gone but the data is not displaying on he form.

    1st code:

    TempTableDS.linkPhysicalTableInstance(TempTable::populateTempTable(parm1, parm2);

    Changed code:

    TempTableBuffer.linkPhysicalTableInstance(TempTable::populateTempTable(parm1, parm2);

    Is there something wrong with this?

    Note:

    TempTableDS - Data source name

    TempTableBuffer - Temporary table buffer declared in class declaration.

  • Suggested answer
    Jesus R. ABASCAL Profile Picture
    1,450 on at
    RE: Temporary table as form data source

    Hi,

    I think do you do a refresh of the data source.

    Regards!

  • Verified answer
    Martin Dráb Profile Picture
    232,860 Most Valuable Professional on at
    RE: Temporary table as form data source

    Can you show us your code? From your description, I would expect you to get an error ("The method is only applicable to TempDB table variables that are not linked to existing physical table instance"), if you don't get any, then I obviously don't understand what you're doing. Maybe you're using a new (= wrong) buffer.

    If you need to put data to the table after the form has been initialized, pass a reference to the buffer to your populateTable() method. Nevertheless if you're using a wrong buffer, you have to resolve this problem as well.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,079 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,860 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans