- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2017 02:07 AM
Hi,
I have a client script to set time worked field as read-only if the ticket is created more than a month ago. I already set it to read-only and make hidden the pause/play button but as we have a setting to Start timers automatically and mine is set to true, the time worked still ticking. May I know if there's a way to pause or stop this time? Many thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 06:13 AM
Hi All,
I see there is now way to Pause the automatic timers so what I did is I created a business rule and set my conditions as follows:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2017 02:12 AM
Hello Miro,
The below might help your cause:
https://www.servicenowguru.com/scripting/client-scripts-scripting/pausetoggle-time-worked-field/
Thanks,
Surya Amara
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2017 02:23 AM
Hi Surya,
Many thanks, we already have this script. What I want to do now is to pause it even if my timers start automatically. Do you know how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2017 02:27 AM
Hello Diane,
I don't think the nature of the field-type allows to pause the field itself.
You can however set the value of this property: "glide.ui.timer.started" = false; which will allow not to run the timer automatically.
Thanks,
Surya Amara
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2017 02:50 AM
Hi,
The code "glide.ui.timer.started" = false; have a lot of errors in warning, can you show how will I add it on this code?
function onLoad() {
//Type appropriate comment here, and begin script below
var user = new GlideRecord('sys_user');
user.get(g_user.userID);
if('sys_created_on', '>', 'javascript:gs.monthsAgo(1)'){
g_form.setReadOnly('time_worked', true);
jQuery('#link\\.incident\\.time_worked').parent().hide();
}
}