Unified Operations & Dynamics AX Forum

Expand all | Collapse all

How to disable/prevent a dialog box from popping up

  • 1.  How to disable/prevent a dialog box from popping up

    GOLD CONTRIBUTOR
    Posted 17 days ago
    ​We have discovered that when the following dialog box pops up, some users are inadvertently checking the "Disable button" checkbox, which results in the Attachments button not highlighting on SOs, POs, etc when it should be highlighted.

               Optimizing toolbar button
    The form name is Dialog, and the Caller is the DocuToolbarButtonCheck class.

    Is there a setting in AX 2012 that controls whether or not this dialog box pops up?  If not, can we prevent the box from popping up via X++ code?  Since we don't want the users to disable the button, it makes more sense to prevent this dialog box from popping up in the first place.

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------


  • 2.  RE: How to disable/prevent a dialog box from popping up

    Posted 10 days ago
    Maybe just disable the Checkbox?

    public Object dialog()
    {
    DialogRunbase dialog = super();
    DialogWindow windowCtrl;
    DialogGroup dlgGrp1,dlgGrp2;
    DialogText staticTxt;

    #resAppl
    ;
    dialog.windowType(FormWindowType::PopUp);
    dialog.alwaysOnTop(true);

    dlgGrp1 = dialog.addGroup();
    dlgGrp1.frameType(FormFrameType::None);

    dlgGrp2 = dialog.addGroup('',dlgGrp1);
    dlgGrp2.frameType(FormFrameType::None);
    dlgGrp2.columns(2);
    dlgGrp2.widthMode(FormWidth::ColumnWidth);
    dlgGrp2.heightMode(FormHeight::ColumnHeight);

    windowCtrl = dialog.addInfoImage();

    staticTxt = dialog.addText("@SYS70864"+'\n\n'+"@SYS70865");
    staticTxt.widthMode(FormWidth::ColumnWidth);
    staticTxt.heightMode(FormHeight::ColumnHeight);
    staticTxt.displayLengthMode(0);
    staticTxt.displayLengthValue(50);

    //dlgDisableButton = dialog.addFieldValue(enumStr(NoYes),disableButton,"@SYS70866");
    // dlgDisableButton.alignControl(true);

    dlgShowNotAgain = dialog.addGroup('',dlgGrp1);
    dlgShowNotAgain.frameType(FormFrameType::None);
    dlgShowNotAgain.frameOptionButton(FormFrameOptionButton::Check);
    dlgShowNotAgain.optionValue(0);
    dlgShowNotAgain.hideIfEmpty(false);
    dlgShowNotAgain.caption("@SYS70363");

    return dialog;
    }

    ------------------------------
    Harald Pfitzner
    Gebr. Dorfner GmbH & Co. KG
    Hirschau
    ------------------------------



  • 3.  RE: How to disable/prevent a dialog box from popping up

    GOLD CONTRIBUTOR
    Posted 10 days ago
    ​Harald, thanks for your suggestion.  I actually did find a way to disable that popup box by modifying the DocuToolbarButtonCheck.main() method.  I basically just commented out the 3 lines of code and added a return statement, which prevents the popup from rendering.  But it might be a good idea to also implement your suggestion.  Thanks!

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------



  • 4.  RE: How to disable/prevent a dialog box from popping up

    Posted 7 days ago

    To prevent this Optimizing toolbar button dialog we can comment line no. 5 and 8 of main method in DocuToolbarButtonCheck class, so the dialog which is called from base class i.e. RunBase from which  DocuToolbarButtonCheck class is extended would not be executed as shown in below screenshot.

    eBRFRQztS5SY2iTaxLZ7_1.jpg

     



    ------------------------------
    Angna Thakkar
    Dynamics AX/ D365 - Sr. Project Manager
    Synoptek, India
    Ahmedabad
    ------------------------------



  • 5.  RE: How to disable/prevent a dialog box from popping up

    GOLD CONTRIBUTOR
    Posted 6 days ago
    ​Thanks Angna!

    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------