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

Query object not initialized error in custom lookup field

$
0
0

Hi all,

I have one sample table named worker Table, in which field named worker id, i want to show the field worker id as look-up in the form. I tried with a following code(first used in form datasource(worker table-->Workerid), then with design(group-->workerid) in the form),

public void lookup(FormControl formControl, str filterStr)
{
    Query query;
    QueryBuildDataSource querybuilddatasource;
    QueryBuildRange querybuildrange;
    SysTableLookup systablelookup = SysTableLookup::newParameters(tableNum(WorkerTable),_formControl);
    systablelookup.addLookupfield(fieldNum(WorkerTable,WorkerID));
    querybuilddatasource =query.addDataSource(tableNum(WorkerTable));
    //queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, CustGroup));
    //queryBuildRange.value('40');
    systablelookup.parmQuery(query);
    systablelookup.performFormLookup();
    //super();
}

But when in select worker id(look up) field in the form i am getting error as below

Query object not initialized.
Stack trace
(C)\Forms\WorkersTable\Data Sources\WorkerTable\Fields\WorkerID\Methods\lookup - line 12
(C)\Classes\FormStringControl\PerformDBLookup
(C)\Classes\FormStringControl\Lookup

Please help me to clear this error.


Viewing all articles
Browse latest Browse all 72043

Trending Articles



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