AX – D365FO – Prevent from closing Runbase after pressing OK or Close button

Suppose you have a Runbase dialog but before do something you want to ask user if he’s really sure he want to proceed with the elaboration.

After clicking OK a popup dialog form opens and asks the user if he wants to proceed

If ho click OK the elaboration starts, otherwise if he clicks on Cancel the focus must return to the Runbase form.

Create “openParmsDialog” new method.

This method opens the new dialog form

public boolean openParmsDialog()

{

   boolean                 ret = true;

   Dialog                  dialog;



       dialog = new Dialog("Override previos period?");

        dialog.run();

       if (dialog.closedOk())

       {

           ret = true;

       }

       else

       {

           ret = false;

       }

   return ret;

}

Now put this code into validate method

public boolean validate(Object _calledFrom = null)
{
   boolean ret = super();
   if (ret)
   {
       ret = this.openParmsDialog();
   }
 
   return ret;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s