How to disable/prevent a dialog box from popping up

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

    Posted by DSC Communities on September 7, 2018 at 3:58 pm
    • Rudy Salcedo

      Member

      September 7, 2018 at 3:58 PM

      ?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
      ——————————

    • Harald Pfitzner

      Member

      September 14, 2018 at 10:31 AM

      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″+’nn’+”@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
      ——————————
      ——————————————-

    • Rudy Salcedo

      Member

      September 14, 2018 at 5:13 PM

      ?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
      ——————————
      ——————————————-

    • Angna Thakkar

      Member

      September 17, 2018 at 10:10 AM

      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
      ——————————
      ——————————————-

    • Rudy Salcedo

      Member

      September 18, 2018 at 9:27 AM

      ?Thanks Angna!

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

    DSC Communities replied 6 years, 12 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘How to disable/prevent a dialog box from popping up’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!