Announcements
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:
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
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.
It works now. Thank you so much Martin.
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.
Oh. I did not realize that.
Could you kindly help me out in resolving that error?
If you populate a new buffer that has nothing to do with the form datasource, how could the data magically appear on the form?
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.
Hi,
I think do you do a refresh of the data source.
Regards!
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.
André Arnaud de Cal...
294,079
Super User 2025 Season 1
Martin Dráb
232,860
Most Valuable Professional
nmaenpaa
101,158
Moderator