Hey! I have to display for the Sales Responsible and for the Sales Taker only the sales that belong to them. If I write the code as written below, I have to complete both fields in order for the Sales ID lookup to be displayed correctly, but there may be a situation when the Sales Responsible and the Sales Taker are two different people. How can I display this?
public void lookupSalesId(FormStringControl _control) { Query query= new Query(); Query query1= new Query(); QueryBuildDataSource qbds1,qbds2,qbds3,qbds4; QueryBuildRange qbr1; SysTableLookup sysTablelookup; contract = this.dataContractObject(); sysTablelookup =SysTableLookup::newParameters(tableNum(CustInvoiceJour),_control); sysTablelookup.addLookupfield(fieldNum(CustInvoiceJour,SalesId)); qbds1=query.addDataSource(tableNum(CustInvoiceJour)); qbds1.addRange(fieldNum(CustInvoiceJour, InvoiceAccount)).value(dialogInvoiceAccount.value()); qbds2=qbds1.addDataSource(tableNum(SalesTable)); //qbds2.joinMode(JoinMode::InnerJoin); qbds2.addLink(fieldNum(CustInvoiceJour, SalesId), fieldNum(SalesTable, SalesId)); qbds2.addRange(fieldNum(SalesTable, WorkerSalesResponsible)).value(queryValue(dialogSalesResponsible.value())); qbds2.addRange(fieldNum(SalesTable, WorkerSalesTaker)).value(queryValue(dialogSalesTaker.value())); sysTablelookup.parmQuery(query); sysTablelookup.performFormLookup(); }