Lookup form

Hi,

I would like to create a custom lookup form that looks pretty much like a regular form (tab pages f.e.).

Now with this code you can run any form from the lookup method on the field of the calling form:

public void lookup()
{
//super();
Args args;
Object formRun;
;

args = new Args();
args.name(formstr( - NAME OF MY CUSTOM FORM - ));
args.caller(this);

formRun = classfactory.formRunClass(args);
formRun.init();

print this.performFormLookup(formRun);

}

the problem is:

A : when i run thelookup, the called form doesnt appear as a lookup, it just pops up in a random place on the screen.

B : when i select a record in the lookup form, the value is not automatically transferred to the field in the calling form

Any suggestions?

A: Set Frame to border

B: In init() method after super call the following method:

element.selectMode(nameOfControl); // What to return to your field

Obviously nameOfControl has to be set to AutoDeclaration = Yes and the value of this control you choose as parameter to selectMode() will be written back to the field.

Hope this helps