Comments on: Solving the Client Script ‘Before and After’ Problem https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/ ServiceNow Consulting Scripting Administration Development Thu, 07 Mar 2024 15:46:00 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Vijay https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8648 Wed, 29 Sep 2021 01:22:45 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8648 Excellent article !

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8647 Tue, 28 Feb 2017 19:26:32 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8647 In reply to Mariano Lemus.

Thanks! Should work great in Istanbul as well.

]]>
By: Mariano Lemus https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8646 Tue, 28 Feb 2017 19:25:38 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8646 Great post Mark, just implemented in Geneva.

Will try it out in Istanbul.

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8645 Thu, 27 Oct 2016 14:01:39 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8645 In reply to HD.

Yes it does! Thanks so much for posting this solution here. I was pretty disappointed when the old functionality was broken so this is very nice to have something that works again. I’ve updated the article above with this code and some new screenshots.

]]>
By: HD https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8644 Thu, 27 Oct 2016 12:51:12 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8644 In reply to David.

This works on Helsinki:

//Show the loading dialog immediately as the form loads
var loadingDialog = new GlideDialogWindow("dialog_loading", true);
loadingDialog.setPreference('table', 'loading');
loadingDialog.setTitle('Loading...'); //Set the loading dialog title here...
loadingDialog.render();
                  
//Wait until the form has finished loading
addLateLoadEvent(function(){
    loadingDialog.destroy();
});
]]>
By: Asparuh Vasilev https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8643 Tue, 13 Oct 2015 15:20:44 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8643 I am also interested if this works in UI15 with Fuji. I wasn’t able to run this workaround. Thanks in advance.

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8642 Tue, 14 Jul 2015 18:00:07 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8642 In reply to David.

This issue has to do with the fact that ‘showLoadingDialog’ isn’t available to call right when the form loads due to some changes ServiceNow has made in Fuji. The only way I know of to attempt to work around the issue is to delay the display of the loading dialog. I don’t know if it works 100% of the time, but you can see an example of that type of script at the bottom of the comments section here.

]]>
By: David https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8641 Tue, 14 Jul 2015 16:09:58 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8641 In reply to Mark Stanger.

Hello,

This does not seem to work in FUJI. Is there any other way to make it work? Thanks!

]]>
By: Stephen Mcleavey https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8640 Wed, 27 May 2015 19:03:33 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8640 Does this work in UI15?

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/solving-client-script-before-after-problem/#comment-8639 Mon, 16 Mar 2015 12:51:00 +0000 https://servicenowguru.wpengine.com/?p=3789#comment-8639 In reply to Christian.

It may be a timing issue. You can try using a ‘setTimeout’ call to make sure ‘showLoadingDialog’ is available to call. Something like this in your UI macro maybe.

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
   <g:evaluate var="jvar_show_dialog" expression="!RP.isPopup()" />
   <j:if test="${jvar_show_dialog}" >
      <script>
         //Show the loading dialog immediately as the form loads
         setTimeout(function(){ showLoadingDialog(); }, 500);
         //Wait until the form has finished loading
         addLateLoadEvent(function(){
            hideLoadingDialog();
         });
      </script>
   </j:if>
</j:jelly>
]]>