Hello.
I am using QueryBuildDataSource.
How can I locate the current cursor, if I know what is the exact key (Using QueryBuildDataSource) ?
Thanks :)
*This post is locked for comments
Hello.
I am using QueryBuildDataSource.
How can I locate the current cursor, if I know what is the exact key (Using QueryBuildDataSource) ?
Thanks :)
*This post is locked for comments
Found.
This is a simple solution, that I could find at your answer this one.
just put on "ExecuteQuery" method of datasource the lines :
MyRefTable = element.args().record();
MyTable_ds.findValue(fieldNum(MyTable, MyColumn), MyRefTable.MyRefColumn);
(MyRefTable.MyRefColumn has the appropiate value that I should focus on the new table).
Thanks, anyway :)
I see that the question was probably answered, anyway I'll post my answer too, because the question may not to be actually about cursors at all. :-)
GPaperLookup is not a standard form. I'll assume that packagingGrid is a FormGridControl. In that case, don't try to get value from the grid, use rather its underlaying data source. If it GPaperTable is the corresponding data source, you have two (basic) possibilities:
For single-selection scenarios, get the value directly from GPaperTable variable.
For multi-selections, the easiest way would be something like this:
GPaperTable paperTable;
MultiselectionHelper selection = new MultiselectionHelper();
selection.parmDatasource(GPaperTable_ds);
paperTable = selection.getFirst();
while (paperTable)
{
//do something
paperTable = selection.getNext();
}
The cursor on the grid equals the cursor to the form data source which represents the data provider for the grid.
Just take the name of the data source and add underscore & 'ds' to access the form data source. The cursor is retrieved by the method cursor().
Example:
myEmplTableBuffer = emplTable_ds.cursor();
OK.
There is a grid component (I don't know if it is global to Microsoft Dynamic AX.
Specificaly on : GPaperLookup, GPaperTable init event. The packagingGrid component).
How can I locate the cursor on the grid component?
Thanks :)
QueryBuildDataSource is a query specification only, it doesn't fetch any data.
If you are using QueryRun, you can obtain current record by calling get(yourTableId).
If you are on a form, you can also use FormDataSource.cursor().
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156