Is there any option on timer field to write onChange client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 11:23 PM
Is there any option on timer field to write onChange client script? If some one changes it manually i need to alert message. How to achieve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 12:23 AM
Hi Swathi,
Can you explain your requirement in detail?
Do you want to add timer i.e. you want to wait for few seconds before performing any other activity?
you can wait for particular number of seconds using this line of code
setTimeout(callAfterTimer, 5000); // this will call the function after a period of 5000 milliseconds
you can then write your code in the function callAfterTimer
Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 12:33 AM
HI Swathi,
You can try below example.
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == oldValue){
return;
}
window.setTimeout(fun2,5000);
}
function fun2(){
// do your stuff here
alert('I waited 5 seconds.');
var caller = g_form.getReference('caller_id');
g_form.setValue('location', caller.location);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 12:40 AM
I have a incident form in which am having a field called Timer (type is timer), Whenever person opens timer will start, and it is editable also, i want to alert message, when some one edit this timer field.
ie.,
onChange of Timer
{
alert('You editing timer');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 12:41 AM
I have a incident form in which am having a field called Timer (type is timer), Whenever person opens timer will start, and it is editable also, i want to alert message, when some one edit this timer field.
ie.,
onChange of Timer
{
alert('You editing timer');
}