I've created a custom lookup form in Axapta 3.0 in which a user can select an OprId from a ProdRoute datasource. Before displaying the lookup the ProdId is set and may not be altered by the user. The user may only select an OprId from the ProdRoute of the production order with the valid ProdId. According to documentation, one can prevent the user from altering the query by locking the range. I've done so like this:
qbrProdId.value(queryValue(_prodId));
qbrProdId.status(RangeStatus::Locked);
Here qbrProdId is a variable of type QueryBuildRange and _prodId specifies the ProdId.
When the lookup is displayed and the user tries to change the filter the ProdId is locked. Good. However, when the user presses Ctrl+F on the ProdId field of the lookup, or if the user clicks on Search on the toolbar a different ProdId can be entered.
How can I prevent this?
I've thought of changing the ProdId field in the grid of the lookup to be of type "Display" instead of being a datasource field. But isn't there a better solution for this?
(By the way, the query is not automatically created but created manually in the "init" method of the form datasource).