You do not say which modal dialog is giving you trouble.
I assume you're not talking about your own CSXS ModalDialog. You should have no issues with that.
If you are using scripting or ScriptUI modal dialogs, those will pose a problem, as will built-in modal dialogs.
The only thing UserIteractionLevels does is prevent certain modal dialogs from popping up while a script is running. It will not make the modaless.
Yes sorry, my post lacked some precision. I was talking about built in dialogs.
The download process can take some time, and during that time the user might open a dialog, say the 'New document' one.
So if I can't do anything about those dialogs getting open, and having it blocking my code, what would be the recommended solution? What are the best practices for those cases?
You can check if there is any modal dialogs active:
$.writeln ( app.modalState ); // returns TRUE if any modal dialog is active
and maybe postpone the code execution until modalState becomes false.
Hope that helps.
Yup. Probably the best solution is to use a timer to stall until the app is not in a modal state.
Thanks a lot guys. I added a timer and wait for the dialog to be closed.