Add exist form to AX lookup

It is different between normal lookup .

public void lookup()
{
    HcmWorker   selectedRecord;
    Args        args;
    FormRun      formRun;
    Form         workerLookupForm = new Form(formStr(HcmWorkerLookup));

    FormControl       control       = this;
    FormStringControl stringControl = control as FormStringControl;

    args = new args();
    args.name(formStr(HcmWorkerLookup));
    args.caller(this);
    args.parmObject(this);

 /*   selectedRecord = HcmWorker::findByPersonnelNumber(stringControl.text());
    if(selectedRecord.RecId != 0 )
    {
        args.lookupRecord(selectedRecord);
    }*/

    formRun = FormAutoLookupFactory::buildLookupFromCustomForm(stringControl,workerLookupForm,
        AbsoluteFieldBinding::construct(fieldStr(HcmWorker, Personnelnumber),tableStr(HcmWorker)),args);

    stringControl.performFormLookup(formRun);
}
Add exist form to AX lookup_第1张图片
图片.png

你可能感兴趣的:(Add exist form to AX lookup)