Hi,
I have 2 datasources, Custinvoice jour and custinvoicetrans in a form. Used a inner join on custinvoicetrans table. Requirement is to filter records on form, based on order account, date range and item id. order account is available custinvoicejour table. daterange and itemid is available in custinvoicetrans. With the below code, only order account is filtering, but not the date range and item id. why is that so?
class declaration
QueryBuildRange custAccount,Itemids, daterange;
CustInvoiceJour init ds
custAccount = this.query().dataSourceNo(1).addRange(fieldnum(CustInvoiceJour,orderaccount));
CustInvoiceJour execute query.
public void executeQuery()
{
if(Account.text()!="")
{
custAccount.value(queryValue(Account.text()));
}
else
{
custAccount.value(SysQuery::valueUnlimited());
}
super();
}
Custinvoicetrans init ds
Itemids = this.query().dataSourceNo(2).addRange(fieldnum(CustInvoiceTrans,ItemId));
daterange = this.query().dataSourceNo(2).addRange(fieldnum(CustInvoiceTrans, InvoiceDate)
CustInvoiceTrans execute query
public void executeQuery()
{
if(Itemid.text()!="")
{
Itemids.value(queryValue(Itemid.text()));
}
else
{
Itemids.value(SysQuery::valueUnlimited());
}
if (FromDate.dateValue() && ToDate.dateValue() )
{
daterange.value(SysQuery::range( FromDate.dateValue(), ToDate.dateValue()));
}
else
{
daterange.value(SysQuery::valueUnlimited());
}
super();
}