Create FormLookup

Simply, you can duplicate the form : PBAItemIdLookup

After that, you can use this code in your Lookup method in the form :

public void lookup(FormControl _formControl, str _filterStr)
{
    RecId                       recId;
    Args                        args        = new Args();
    Object                      formRun;
    ;

//    super(_formControl, _filterStr);


    args    = new Args(formstr(MyForm));
    args.caller(element);
    args.record(MyRecord);
    formRun = classfactory.formRunClass(args);
    formRun.init();
    this.performFormLookup(formRun, _formControl);

    //If you need receive an other information from your form, 
    //You can create a parm Method use this like this :
    formRun.wait();
    recId   = formRun.parmRecId();
}
Advertisements