D365FFO – AX – X++ – Custom Lookup for a dialog field

This post discusses about creating a custom lookup field on a dialog.
Following are the methods and code required to achieve the purpose.(Assuming the class is extending the RunbaseBatch)

–> A lookup method is required in the first place. Below is the sample code to lookup the exchange rates.
private void exchRate_Lookup(FormStringControl _control)
SysTableLookup sysTableLookUp;
QueryBuildDataSource qbds;
Query query = new Query();

qbds = query.addDataSource(tableNum(ExchangeRateType));

sysTableLookUp = SysTableLookup::newParameters(tableNum(ExchangeRateType), _control, true);

sysTableLookUp.addLookupfield(fieldNum(ExchangeRateType, Name));
sysTableLookUp.addLookupfield(fieldNum(ExchangeRateType, Description));

–> The above method can then be called in the dialog method of the runbase class

public Object dialog()


FormStringControl control;

dialog = super();

dlgExcRate = dialog.addField(extendedTypeStr(ExchangeRateTypeName));

control = dlgExcRate.control();

control.registerOverrideMethod(methodstr(FormStringControl, lookUp),methodstr(SampleBatchClass, exchRate_Lookup),this);

return dialog;


Note:When we are using this FormStringControl lookup then the batch class “runon” property shouldn’t be “server”


Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...