Hi Friends,
I am running into problem. Which appears it's query filter issue.
I have a form, let user put in start/end date to query vendtable and vendtrans tables.
In form init() method, I initialize the start/end date for last month, then, user can change the date to whenever they want.
Problem I had is, whenever the date user change to, it always keep the last month data plus the data within date range user just put in.
I tried to clean the filter when button clicked, but, it doesn't work.
Any help is appreciated.
Here is my code:
This is from vendtable datasource executequery() method:
------------------------------
//filter on VendTrans table
diversifiedVendTransQBR2 = this.query().dataSourceTable(TableNum(VendTrans)).addRange(fieldNum(VendTrans, TransDate));
diversifiedVendTransQBR2.value(SysQuery::range(StartDate.dateValue(), EndDate.dateValue()));
This is from FORM init():
public void init()
{
super();
StartDate.dateValue(prevMth(systemdateget()));
EndDate.dateValue(systemdateget());
}
This is from button click method:
void clicked()
{
VendTable_ds.removeFilter();
VendTrans_ds.removeFilter();
VendTable_ds.refresh();
VendTable_ds.executeQuery();
super();
}