cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do you add SP.UI.ModalDialog.showWaitScreenWithNoClose after save/submit on a form (while the workflow is running).

I have a form where I have forced the workflow to complete while the item is being created (using conditional statements on the workflow) before the form is closed. 

 

Sometimes, the workflow can take up to 15-20 seconds to complete.  I'd like to have a "Please wait..." display for the employee while that is happening instead of the white screen.

 

I tried adding NWF$(document).ready(function () {SP.UI.ModalDialog.showWaitScreenWithNoClose('Working on it', 'Action Plan is saving...');})} to the Client Click of the save button.  This worked great when the form validates but if the form doesn't validate, you can see required fields in the background but can't access them again.

 

Is there an easy/easier way to accomplish this?

Labels: (3)
Reply
3 Replies
Not applicable

Re: How do you add SP.UI.ModalDialog.showWaitScreenWithNoClose after save/submit on a form (while the workflow is running).

You need to create a function in Custom Javascript

function MyButtonOnClientClick()

{

   Page_ClientValidate();

   if(Page_IsValid)

   {

      SP.UI.ModalDialog.showWaitScreenWithNoClose('Working on it', 'The action plan is saving...');

      return true;

   }

   else

   {

      return false;

   }

}

 

And then add javascript:MyButtonOnClientClick(); to the client click of the save button.

Reply
darrentcs
Nintex Newbie

Re: How do you add SP.UI.ModalDialog.showWaitScreenWithNoClose after save/submit on a form (while the workflow is running).

Hi Frederic,

I wonder if you can help me, I am looking to do something with a workflow initiation form I have opened in a sp dialog window. When the form is submitted the form closes, but the main modal dialog window doesn't close. I see you created some script on the submit button and called a function. Is there a way to modify your script where when the submit btn is clicked it  calls a function that waits for the workflow to start or/and complete then closes the diag modal window.

I posted this question on the site but yet to get an answer that will solve this. Thread here:

Close Nintex Workflow form in Diag Modal Window

Any help appreciated.

0 Kudos
Reply
markd
Nintex Newbie

Re: How do you add SP.UI.ModalDialog.showWaitScreenWithNoClose after save/submit on a form (while the workflow is running).

Hello Fredric - Thank you for posting this solution last year. 

1) I've tried to implement this in a Nintex 2013 form and used it in a 2 control buttons, one that uses Button Action "Save and Submit", and the other "Save."
This pop-up display works fine when I click the button and displays the text correctly, but the message pop- just hangs there and does not close.  I assume the intent was that the message would display only while the screen is waiting for the WF or Save action to complete, and then the pop-up would close.

What am I missing please?

2) Also, is there a way to change the size of the display font within the pop-up?

Thank you in advance for your assistance.

0 Kudos
Reply