Step 1: Create a Form for lookup called “CustVendLookup” with following designs:
Figure 1 Create CustVendLookup
Step 2: Override run() and init() methods on "CustVendLookup" Form and write below code-
public void run()
{
FormStringControl callingControl;
boolean filterLookup;
;
callingControl = SysTableLookup::getCallerStringControl(element.args());
filterLookup = SysTableLookup::filterLookupPreRun(callingControl,
{
FormStringControl callingControl;
boolean filterLookup;
;
callingControl = SysTableLookup::getCallerStringControl(element.args());
filterLookup = SysTableLookup::filterLookupPreRun(callingControl,
AccountNum,CustTable_ds);
super();
SysTableLookup::filterLookupPostRun(filterLookup,callingControl.text(),
super();
SysTableLookup::filterLookupPostRun(filterLookup,callingControl.text(),
AccountNum,CustTable_ds);
}
}
public void init()
{
super();
element.selectMode(AccountNum);
}
Step 3: Create a EDT called “CustVendLookupEDT” and set property “FromHelp – CustVendLookup” form.
Step 4: Create a table called “CustVendTable”with one field called “FromAsLookup” and set property ExtendedDataType – CustVendLookupEDT”.
Step 5: Create another form called “ChangeLookup” with below designs-
Figure 2 Create second form “ChangeLookup”
Finally, Open the “ChangeLookup” form and click on lookup with FromAsLookup field. And you will see a lookup with two tab pages Customer and Vendor.
Figure 3 : Result.
Thanks for the sharing
ReplyDelete