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).

+2


source to share


2 answers


OK than you can just override the task () method. This should disable the filter feature on the search 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;
}

      

+1


source


Just use speaker instead of range.



NTN

0


source







All Articles