≡ Menu

How to check Dynamics Ax 2012 form is in edit mode

During development, I wrote code in clicked event of Button. But requirement is that code will works only if form is in edit mode. I used following code to check it

 

boolean _bool;

supper();

_bool=   element.inViewMode();

if (_bool==boolean::true)
{
info (“true”);
}
else
{
info (“false”);
}

This  method element.inViewMode() return true when form is view mode.
 

{ 0 comments… add one }

Leave a Comment