Automatically closing a form after 1 or 2 seconds

  • Automatically closing a form after 1 or 2 seconds

    Posted by DSC Communities on June 28, 2019 at 4:59 am
    • Fraser Kidd

      Member

      June 28, 2019 at 4:59 AM

      Hi,

      We have AX2012 R3 and are using Time and Attendance for our shopfloor workers to clock-in and out each day. Once they have entered there personnel number or scanned their badge the Clock-in Form appears as below.

      Clock-in Form
      We don’t want the users to have to click OK as this could cause issues(we try to make this process as simple as possible) so we want the form to stay up for a second or 2 and then disappear ready for the next person. At the moment the form stays up for 6 seconds and then disappears with no user intervention.

      Can someone tell me where I can reduce this time to 1 or 2 seconds.

      Thanks in advance
      Fraser

      ——————————
      Fraser Kidd
      Livingston Precision Engineering (Ltd)
      Livingston SC
      ——————————

    • Gretchen Garcia

      Member

      July 1, 2019 at 10:31 AM

      No idea if there is any way to do that within AX, but what about using something like Auto-Hot Key to detect the window and close it after a few seconds? šŸ™‚

      ——————————
      Gretchen Garcia
      IT Technician
      Denver Public Library
      Denver CO
      ——————————
      ——————————————-

    • Alex Meyer

      Member

      July 2, 2019 at 9:15 AM

      Fraser,

      Do you know how you are currently making the form disappear? It is any custom code or native AX?

      I would think you would be able to override the init() method of the form put a sleep timer on it and close the form whenever you want by doing something like.

      public void init()
      {
      Ā  Ā  super();
      Ā  Ā  int seconds = 2;
      Ā  Ā  sleep(seconds*1000);
      Ā  Ā  element.close();
      }

      ——————————
      Alex Meyer
      Director of Dynamics AX/365 for Finance & Operations Development
      Fastpath
      Des Moines, IA
      ——————————
      ——————————————-

    • Kirk Blackburn

      Member

      July 2, 2019 at 12:47 PM

      My brief research suggests that the code to close the form after 6 seconds probably comes from the showClockInfo method of the JmgJobBundle class. This is the AX code in that method:

      /// <summary>
      /// Shows information about the clock in or clock out to the user.
      /// </summary>
      /// <param name=”text”>
      /// The text to show to the user.
      /// </param>
      private void showClockInfo(str text = messageText)
      {

      JmgDialogFormClass dlgForm;
      str infoText;
      if (showInfo)
      {
      infoText = text == “@SYS38409” ? “@SYS309981” : text == “@SYS38411” ? “@SYS309982” :;
      dlgForm = new JmgDialogFormClass(infoText, text, “@SYS5473”, true, 6000, this.parmCallerForm());
      dlgForm.openBreakDialog();
      }

      }

      The true on line 14 indicates that the form should close after a certain timeout period. The 6000 on that same line indicates that the timeout period should last for 6,000 milliseconds (6 seconds) before the form closes.

      Changing the 6000 to 2000 would accomplish that you desire (closing the form automatically after 2 seconds). But, it requires a code customization….

      ——————————
      Kirk Blackburn
      Engineer – Software Development
      The Church of Jesus Christ of Latter-day Saints
      Salt Lake City, UT
      ——————————
      ——————————————-

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

Sorry, there were no replies found.

The discussion ‘Automatically closing a form after 1 or 2 seconds’ 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!