1. To create lookup form, first create a query(Optional) with the required data sources and appropriate relations.
2. Create a lookup form with the query as datasource. Set the style property of the design to Lookup.
3. In the form init(), the following code has to be written after Super()
element.selectMode(DirPartyTable_Name);
where DirPartyTable_Name is control in the grid.
4.Go the form control for which lookup form needs to be assigned(Navigate to the control in the design list ) and override lookupReference(Lookup) based on the field type and add the following code in the method
public Common lookupReference()
{
Args args;
FormRun formRun;
DirPartyTable selectedRecord;
args = new Args();
args.name(formStr(SalesRepLookup));
args.caller(element);
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.selectRecordMode(this);
this.performFormLookup(formRun);
selectedRecord = formRun.selectRecordModeSelectedRecord();
return selectedRecord;
}
That's it we are done with the lookup form.
2. Create a lookup form with the query as datasource. Set the style property of the design to Lookup.
3. In the form init(), the following code has to be written after Super()
element.selectMode(DirPartyTable_Name);
where DirPartyTable_Name is control in the grid.
4.Go the form control for which lookup form needs to be assigned(Navigate to the control in the design list ) and override lookupReference(Lookup) based on the field type and add the following code in the method
public Common lookupReference()
{
Args args;
FormRun formRun;
DirPartyTable selectedRecord;
args = new Args();
args.name(formStr(SalesRepLookup));
args.caller(element);
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.selectRecordMode(this);
this.performFormLookup(formRun);
selectedRecord = formRun.selectRecordModeSelectedRecord();
return selectedRecord;
}
That's it we are done with the lookup form.
No comments:
Post a Comment