Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

how to Create query in X++ by code to get only selected fields ?

$
0
0

Hi All,

I want to create a query using X++ code to get only two fields Dataarea and Name from CompanyInfo Table  in the lookup. there are many fields in table and all are coming.

Class declaration code :-

SysLookupMultiSelectCtrl msctrl;
Query q;
QueryRun qr;
QueryBuildDataSource qbd;
QueryBuildRange qbr;

Form Init method code :-

super();
// mzkCompanyId - Name of control on which you want a lookup.
// CompanyInfo - Table name to get the lookup data
q = new Query();
qbd = q.addDataSource(TableNum(CompanyInfo));

msCtrl = SysLookupMultiSelectCtrl::constructWithQuery(element, mzkCompanyId,q);

In this code, I just want to show Dataarea and Name field

how to achieve it ?


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>