Look up method not creating look up

Hi, i have added new field to project N mangment Module in all projects form.

vendor account no. is new field which added.

i want all vendor’s account no’s lookup in that field, from vend Table.

so i have overrided lookup method. at forms newly added field but this look up methood is not working .

kindly help

Methood code is -

public void lookup()

{

Query query ;

SysTableLookup sysTableLookup;

QueryBuildDataSource qbds,queryDataSourceCode;

QueryBuildRange queryBuildRange;

query = new Query();

sysTableLookup = SysTableLookup::newParameters(tableNum(VendTable), this);

qbds = query.addDataSource(tablenum(VendTable));

sysTableLookup.parmQuery(query);

sysTableLookup.addLookupField(fieldNum(VendTable, AccountNum));

sysTableLookup.performFormLookup();

}

You don’t have to do it at all - simply use VendAccount data type for the field; the type already contains a reference to VendTable.

Hi,

i have tried that too, but it is not creating lookup. even after that it is getting invisible.

The data type works, it’s what the standard AX uses. You’re obviously solving a wrong problem.

Could you show us your implementation? There is something blocking the lookup.

Also, what do you mean by “is getting invisible”?

Project Management > common > Projects > All Projects >

after that if we doubleclick on any project then project details will open so here in general tab i am adding two fields.

'Vendor account ’ and 'vendor name ’ from Vend Table.

i simply added Vend table to that forms data source and added two StringEdit to form.

after attaching data source and field name it is not showing look up.

so i have written above mentioned code that is also not working,

Forget about the name and the whole VendTable data source in this moment. Just drag your new field (“vendor account no. is new field which added”) from the ProjTable data source to the design.

Are you able to set a vendor account to the field manually? If the field is not editable, there won’t be any lookup.

Hi,

Martin is right about using extended datatype, but if you really want to use code, you haven’t initiatized your queryBuildRange, just add QueryBuildRange = QueryBuildDataSource.addRange(fieldNum(vendTable,AccountNum)); after qbds = query.addDataSource(tablenum(VendTable));

Regards,

Thomas

Its started working.

i after draging my field to design. and at the same time i restarted services.

thanks 4 help.

Could you please mark a reply (or replies) at the answer, so the whole thread is clearly marked as closed?