Hello Guys,
I want to disable a menu item button under conditions, I did my work on the eventHandler "OnClicked" but the order is coming after we click and finish the process. I want to prevent the user from continuing the confirm button process several condition, so I moved my code to the Activated Event Handler on the form
but no class is working for the button neither the FormControl , FormButtonControl or the FormMenuButtonControl and FormFunctionButtonControl
the function I'm using is sender.FormRun().design(0).ControlName("MENUITEMNAME").enabled(false);
even i tried to remove the (0) from the design but all is the same, nothing is working,
the error i'm receiving in the system is"Unable to cast object from type 'FormControl.buttonConfirm' to type 'Dynamics.AX.Application.FormButtonControl' or any type i chose other than FormControl
and on the FormControl class also don't work.
