- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2017 10:27 PM
I want to hold screen for around 3 secs when i am changing a value of a variable on my form,
what will be the function that i can use in my on change client script.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2017 10:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 02:37 AM
Hi jain,
Please provide the more information your requirment. Any particular reason to hold the screen
Thanks
Chandu telu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 06:15 AM
I agree with Chandu... it's important that we understand the requirement here before trying to implement a solution. You have pointed us to what you believe is the solution, but we don't understand what the use case is. This is risky and can lead to performance issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 05:26 AM
Hi Anshul,
You will have to use the combination of Script Include and synchronous GlideAjax. Follow the below steps to get it done.
1) Create a Client Callable Script include with a single function and gs.sleep(milliseconds) statement.
2) Use Synchronous Glide Ajax on a onChange Client Script to call the above Script Include.
3) Use getXMLWait() function.
Script Include Code
-------------------------------
var PauseScreen3Seconds = Class.create();
PauseScreen3Seconds.prototype = Object.extendsObject(AbstractAjaxProcessor, {
pauseScreen: function(){
gs.sleep(5000);
},
type: 'PauseScreen3Seconds'
});
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
onChange Client Script
-------------------------------
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ps = new GlideAjax('PauseScreen3Seconds');
ps.addParam('sysparm_name','pauseScreen');
ps.getXMLWait();
alert('I waited for 5 seconds');
//Type appropriate comment here, and begin script below
}
For more details refer how to keep waiting the business rule for some time.
Thanks & Regards,
Varad S.Kulkarni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 10:13 PM
Thank you all i some how managed to do what i was looking for,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2019 08:37 PM
Hello,
You can write the below line of code to wait for few seconds.
var setTimer='';
setTimer=setTimeout(setTimerDelay,2000);/*to set the timer for 2 sec*/
function setTimerDelay(){
alert('timer waits for 2 sec');
//your code
}
Hope it will helps you!
Thanks,
Priyanka R