How to lock/disable whole AX form


protected void lockFormScreen(boolean _lock = true)
{
    FormControl formControl;
    int         controlCount, a, id;
    boolean     toState = !_lock;
    
    if (formRun)
    {
        if (_lock)
        {
            formControlState = new Map(Types::Integer, Types::Enum);
        }
        controlCount = formRun.design().controlCount();
        for (a = 1; a <= controlCount; a++)
        {
            formControl = formRun.design().controlNum(a);
            id          = formControl.id();
            if (_lock)
            {
                formControlState.insert(id, formControl.enabled());
            }
            else
            {
                if (formControlState.exists(id))
                {
                    toState = formControlState.lookup(id);
                }
                else
                {
                    toState = _lock;
                }
            }
            formControl.enabled(toState);
        }
    }
}


 

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags