Monday, 17 December 2018

settimeout / Sleep / wait in ServiceNow

setTimeout in ServiceNow

function onChange(control, oldValue, newValue, isLoading) { 
if (newValue == oldValue){
function Test(){
// do your stuff here
alert('Wait for 4 Seconds.');
var caller = g_form.getReference('<field_name>');

Note: You should always use setTimeout(Test,4000) instead of setTimeout(Test(),4000); 

Sleep in ServiceNow
Note : We cant user gs.sleep function in scooped application it has to be used in non-scooped application
sleep: function (duration) {

No comments:

Post a comment