Filter StringEdit values

Hey mates,

I am trying to filter the values of some stringEdit.

When I click (1) on the stringEdit it has some rows, but I want to filter these rows when I click the checkbox (2).

There are some ideas ?

Can you explain it in Detail???

Of course I can explain it in detail.

I have a stringEdit on PurchTable_InventLocationId from PurchTable(PurchTable).InventLocationId on PurchCreateOrder Form with some default and correct values.

I like to filter this values when I check a checkbox, but I don’t know how to apply the filter or range on this control.

Regards.

Override the lookup method of the data source field.

Use SysTableLookup class to get the lookup.

See lookupBOMItemId() method in the InventTable for more information - like how to add ranges…

Uoooo !!! it’s incredible !! It’s the solution ! You’re a machine in AX. Thanks for your answer.

Finally I did:

Override the lookup method of the data source field. and insert this:

InventLocation::lookupBySiteIdAllTypesWarehouseFiltered(_formControl,purchTable.InventSiteId,purchTable.OrderAccount);

InventLocation::lookupBySiteIdAllTypesWarehouseFiltered it’s a method like that:

public client static void lookupBySiteIdAllTypesWarehouseFiltered(FormStringControl ctrl, InventSiteId inventSiteId, AccountNum eve_VendAccountNum)

{

SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(InventLocation), ctrl);

Query query = new Query();

QueryBuildDataSource queryBuildDataSource;

;

sysTableLookup.addLookupfield(fieldnum(InventLocation, InventLocationId));

sysTableLookup.addLookupfield(fieldnum(InventLocation, Name));

sysTableLookup.addLookupfield(fieldnum(InventLocation, InventSiteId));

queryBuildDataSource = query.addDataSource(tablenum(InventLocation));

if (inventSiteId)

queryBuildDataSource.addRange(fieldnum(InventLocation, InventSiteId)).value(queryValue(inventSiteId));

queryBuildDataSource.addRange(fieldnum(InventLocation, EVE_VendAccountNum)).value(queryValue(eve_VendAccountNum));

sysTableLookup.parmQuery(query);

sysTableLookup.performFormLookup();

}