Hi @aaghaei
You can use query.WhereNew() to replace the filtering portion of the query.
selectDetails.WhereNew<Where<PMCostProjectionLine.taskID, IsNotNull>>();
Also, you could change the query through a view delegate.
@Leonardo Justiniano thank you. is it possible to remove the WhereAnd which is added on the fly?
@aaghaei
WhereNew will replace any filter added previously.
Thank you @Leonardo Justiniano I tested this. WhereNew not only removes the conditions added on the fly but also removes the original conditions like as there was no condition from the begining. It is not what I need.
@aaghaei
Yes indeed it removes all Where statement. Please add the original condition when calling (WereNew) if you want to keep it or manage your logic to prevent adding a condition (WhereAnd) when really is not needed, so you avoid removing it later in the call.
@Leonardo Justiniano it is one of the Acumatica base views and this is developed this way. I can not really keey the Where Statement out of main query. But thank you for your time and help.