Hi,
I create a custom lookup with multiple table on lookup field
This is my code :
[FormControlEventHandler(formControlStr(smmOpportunityTable, PartyGroup_Name), FormControlEventType::Lookup)] public static void PartyGroup_Name_OnLookup(FormControl sender, FormControlEventArgs e) { FormDataSource fds = sender.formRun().dataSource("smmOpportunityTable"); smmOpportunityTable opp = fds.cursor(); Query query = new Query(); QueryBuildDataSource qbds, qbds2; QueryBuildDataSource qbdsJoin; SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(DirPartyTable), sender); qbds = query.addDataSource(tableNum(DirPartyTable)); qbds2 = qbds.addDataSource(tableNum(smmBusRelTable)); qbds2.addLink(fieldNum(DirPartyTable, RecId),fieldNum(smmBusRelTable, Party)); sysTableLookup.parmQuery(query); sysTableLookup.addLookupfield(fieldNum(DirPartyTable, Name), true); sysTableLookup.addLookupfield(fieldNum(DirPartyTable, PartyNumber)); sysTableLookup.addLookupfield(fieldNum(smmBusRelTable, BusRelAccount)); sysTableLookup.performFormLookup(); FormControlCancelableSuperEventArgs event = e as FormControlCancelableSuperEventArgs; event.CancelSuperCall(); }
This is the result :
Thanks