Axapta: prevent user from changing request form using search
I created a custom search form in Axapta 3.0 where the user can select the OprId from the ProdRoute data source. Before displaying the search, the ProdId is set and cannot be changed by the user. The user can only select OprId from the ProdRoute of the production order with a valid ProdId. According to the documentation, it is possible to prevent a user from modifying the query by locking the range. I did it like this:
qbrProdId.value(queryValue(_prodId));
qbrProdId.status(RangeStatus::Locked);
Here qbrProdId is a QueryBuildRange variable and _prodId indicates ProdId.
When a search is displayed and the user tries to change the filter, ProdId is blocked Good. However, when the user presses Ctrl + F in the search ProdId field, or the user clicks on Search in the toolbar, a different ProdId may be entered.
How can I prevent this?
I thought about changing the ProdId field in the search grid to display type instead of being a data source field. But isn't there a better solution for this?
(By the way, the request is not automatically generated, but created manually in the "init" method for the form data source).
source to share