If you have done a query in a form and you you want to clean previouslu query filter you have to follo w this code
public void executeQuery()
{
// Get the filter value from the filter control.
date firstYearOfMonth;
str monthStr;
str yearStr;
MonthsOfYear monthEnum;
int monthEnumToInt;
TransDate tmpDate;
TransDate dateInMonth;
TransDate firstDateOfMonth;
TransDate endDateOfMonth;
QueryBuildDataSource ds;
monthStr = MonthsList.valueStr();
yearStr = YearsList.valueStr();
ds = this.query().dataSourceTable(tablenum(ERAWriteOffCalculation));
if (yearStr != "")
{
monthEnum = str2enum(monthEnum,monthStr);
monthEnumToInt = enum2int(monthEnum);
tmpDate = str2Date("15/" + int2str(monthEnumToInt) + "/" + yearStr, 123);
dateInMonth=tmpDate;
firstDateOfMonth = DateStartMth(dateInMonth);
dateInMonth=tmpDate;
endDateOfMonth= endmth(dateInMonth);
ds.addRange(fieldNum(ERAWriteOffCalculation, calcdate)).value(queryRange(firstDateOfMonth, endDateOfMonth));
}
else
{
ds.clearRange(fieldNum(ERAWriteOffCalculation,calcdate)); //This code cear previously set filters
}
super();
}