7
var waitingDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Your action is in progress...', "Please wait while we generate the tasks for you.");

error

Unable to get property showWaitScreenWithNoClose of undefined or null reference

I keep getting this error message, how do I fix this?

12

It seems you are missing SP.SOD.executeFunc. Try following.

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function() {
    var waitingDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Your action is in progress...', "Please wait while we generate the tasks for you.");
});

I have tried it and output is following

enter image description here

Reason

SP.UI.ModalDialog execution must be delayed until sp.js and SP.ClientContext are loaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.