dialog Lookup

Dear All,

I am creating the Lookup at the Class level in the Dialog field but i am not getting the Loopup pleas Check the Code.

void Fld6_1_lookup()

{

Query query = new Query();

QueryBuildDataSource qbdsPeriod;

SysTableLookup tableLookup;

;

tableLookup = SysTableLookup::newParameters(tablenum(tableName),Dlg.Control());

tableLookup.addLookupfield(fieldnum(tablename,fieldname),true);

qbdsPeriod = query.addDataSource(tablenum(tablename));

tableLookup.parmQuery(query);

tableLookup.performFormLookup();

}

if any body knows ,please tell me solution…

Thanks in advance,

Murali Krishna

Please, tell us what happens. “I am not getting the Loopup” is the same as “is not working” - useless. For example, is your method called at all? If not, it doesn’t matter what’s inside.

What’s your version of AX (please always add a tag with the version) and what dialog are you trying to create?

Thanks for reply…

when i will run the class ,lookup is not showing into the Dialog field. and version is 2009 only.

i am not getting the any error but lookup is not showing…

Pleas tell me solution…

thanks in advance,

murali krishna

Sorry, but you still didn’t tell us anything about the problem except “lookup is not showing”. If you don’t tell us anything, we can’t help you, since there is no oracle available.

Please verify that your method is called at all (e.g. in debugger). Return here where you know whether it’s called or not.

Try this code at your end.

void Fld1_1_lookup()
{
Query DropDownquery = new Query();
FormControl frmSTr = DialogEcoResCategoryId.dialog().formRun().controlCallingMethod();

QueryBuildDataSource qbds;
QueryBuildRange qbr,qbr1;

SysTableLookup tableLookup;

tableLookup = SysTableLookup::newParameters(tablenum(tableName),frmstr);

qbds = DropDownquery.addDataSource(tableNum(tableName));

sysTableLookup.addSelectionField(fieldNum(tablename,fieldname));
sysTableLookup.addLookupField(fieldNum(tablename,fieldname));

sysTableLookup.parmQuery(DropDownquery);
sysTableLookup.performFormLookup();

}