Home
> Ax Technical > Access the query of a formDatasource in Dynamics Ax
Access the query of a formDatasource in Dynamics Ax
We all know well that to access the datasource in a form we use table name suffixed by DS. But there is one another similar suffix that can help us access the datasource query. See example below to understand.
Eg:
//note the suffix "_q"used to access the query. InventTable_q.datasourcetable(tablenum(InventTable)).addRange(fieldnum...
This is not widely used but can be of help at times.
just to add you can also use “_qr” to use the queryrun instance of the formdatasource
This was new too me. Thanks for recover.
Thanks for the comment Daniel. Yeah that can be true. But my feeling says it is matter of getting used too.
Hi!
It’s true, can be helpful, but could create some confusion in some developers who start wondering where is Inventable_q variable declaration.
I think it isn’t a good practice, what do you think about it?
Have a nice weekend!