How to add lookup form on Runbase Dialog

Hi All,

Today, I am demonstrating on how to add lookup form on RunBase Dialog.
Firstly, I want to give a brief introduction about RunBaseBatch Class.
This Class is used to schedule the batch jobs. So, Adding lookup form
to RunBase Dialog starts with Class Declaration.

class SampleComboDialog extends RunBaseBatch

DialogRunbase dialog;
DialogField nameField;


In the above class declaration, I declared dialog object of type DialogRunbase & nameField of type DialogField and then i overrided dialog method.

protected Object dialog()

FormStringControl   control;
dialog = super();
namefield = dialog.addField(extendedTypeStr(Name));
control = namefield.control();

return dialog;


You have to override the lookup() method with lookup form being as parameter.

rivate void nameLookup(FormStringControl _control)
SysTableLookup sysTableLookup;
QueryBuildDataSource qbds;

Query query = new Query();
qbds = Query.addDataSource(tableNum(SampleAIFTbl));
sysTableLookup = SysTableLookup::newParameters(tableNum(SampleAIFTbl), _control,true);
sysTableLookup.addLookupfield(fieldNum(SampleAIFTbl, Name), true);


Binding this nameField with FormStringControl, used registerOverrideMethod to be used as overridden method by dialog object.

Simple run method

public void run()
info(strFmt(” the result is %1″, nameField.value()));

It displays the value selected in lookup but it requires to initialization of RunBase Class Object. This is has to be written in main method of respective class.

public static void main(Args _args)
SampleComboDialog sampleComboDialog;
sampleComboDialog = new SampleComboDialog();


So, I compile & run it and here is the Output.


Suppose, If I select Add Operation from the lookup and press ok then, here it is the output.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: