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)

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

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,912 Most Valuable Professional on at

    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.

  • Suggested answer
    Jesus R. ABASCAL Profile Picture
    1,450 on at

    Hi,

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

    Regards!

  • Community Member Profile Picture
    on at

    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.

  • Martin Dráb Profile Picture
    237,912 Most Valuable Professional on at

    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

    Oh. I did not realize that.

    Could you kindly help me out in resolving that error?

  • Verified answer
    Martin Dráb Profile Picture
    237,912 Most Valuable Professional on at

    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

    It works now. Thank you so much Martin.

  • Faisal Raja Profile Picture
    10 on at

    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.

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