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).
OK, than you can just override the task() method. This should disable the filter functionallity on the lookup form.
public int task(int _taskId)
{
int ret;
switch(_taskId)
{
case 2855:
case 2844:
case 2837:
case 799:
return 0;
}
ret = super(_taskId);
return ret;
}
Just use a dynalink instead of range.
HTH
精彩评论