Hi All,
I am using AX2012 R3 CU13.
There is a typical requirement from customer for a search in a form which made me to apply query range from a set ( setS ) of values as follows :
In method : applyqueryfilters(_query)
pfrds = sysquery::findorcreatedatasource(_query,TableAbc);
sI = new SetIterator(setS);
while (sI.more())
{
pfrds.addRange(fieldNum(TableAbc , QId)).value(sI.value());
sI.next();
}
Now whenever there is a new search the Set changes and the results are expected to fetch accordingly.
I tried clearing the ranges by :
_query.dataSourceTable(tableNum(TableAbc)).clearRange(fieldNum(TableAbc,QId)); or
or using pfrds.clearRange(fieldNum(TableAbc,QId))
However I am unable to clear the range completely . For example if they are 4 elements on the set and I use either of the above statements the filter on only one element is cleared. To clear the entire range apparently i will have to write the clearRange statement for the number of times as the length of the set.
Could anyone please let me know how can I clear entire range of previous set using only one statement.
PS : there are already different ranges applied on other fields in TableAbc .
Thanks in advance.