// Form Lookup thorugh code
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);
// position the lookup to highlight the current record
// a string control supposed to contain a personnel number value
selectedRecord = HcmWorker::findByPersonnelNumber(stringControl.text());
if (selectedRecord.RecId != 0)
{
args.lookupRecord(selectedRecord);
}
// perform form lookup on the caller form control
formRun = FormAutoLookupFactory::buildLookupFromCustomForm(stringControl, workerLookupForm , AbsoluteFieldBinding::construct(fieldStr(HcmWorker, PersonnelNumber), tableStr(HcmWorker)), args);
stringControl.performFormLookup(formRun);
//selectedRecord = formRun.selectRecordModeSelectedRecord();
}
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);
// position the lookup to highlight the current record
// a string control supposed to contain a personnel number value
selectedRecord = HcmWorker::findByPersonnelNumber(stringControl.text());
if (selectedRecord.RecId != 0)
{
args.lookupRecord(selectedRecord);
}
// perform form lookup on the caller form control
formRun = FormAutoLookupFactory::buildLookupFromCustomForm(stringControl, workerLookupForm , AbsoluteFieldBinding::construct(fieldStr(HcmWorker, PersonnelNumber), tableStr(HcmWorker)), args);
stringControl.performFormLookup(formRun);
//selectedRecord = formRun.selectRecordModeSelectedRecord();
}
No comments:
Post a Comment