Hi Guys,
I need to apply a default filter on a form which is Purchase Journals. specifically I need to see only those Purchase orders where purchase type are Journals only and no user should be able to remove this filter from the form. Actually its a common form used for Purchase Order Details and Purchase Journals.
so is it possible to do this filter only when I open it through Purchase journals ? currently the filter is applied on the form but the users are able to remove this filter. how can we stop the users to remove it ?
If you know how to add the range in code, the only change you need is set its Status to either Locked or Hidden. For example:
queryBuildRange.status(RangeStatus::Locked);
Thanks Mr. Martin.
Could you please explain in detail how and where to add the range in the code ?.
I have never tried it as I am a beginner in development.
You said that “currently the filter is applied on the form”. How did you do it?
In the menu item I gave the Enum parameter as Journals. I need this filter to be stable no user should able to change or remove the filter.
Unfortunately I don’t have any AX 2009 environment, therefore I can’t look at how exactly it’s implemented. Check where the form reads the parameter (element.args().parmEnum()) and add the QueryBuildRange object. Then you can set its status, as I showed above.
Alternatively you could stop using the parameter and add the range in code.