About Duration field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2008 10:14 PM
How to set and get value of duration field ?
(In wiki they provide on example to set value
ie current.u_time_to_assign.setDisplayValue('3 04:30:14') but it is not working )
How to perform calculation on duration field ?
How to convert integer to duration ?
- Labels:
-
Orchestration (ITOM)
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2008 02:50 PM
Here are a couple notes on Duration fields:
Here's how you can calculate a duration. By default, durations are stored in miliseconds. By using the same syntax, you can perform about any type of calculation.
http://wiki.service-now.com/index.php?title=Duration_field_addition
Note that the example is using the actual "duration" field, as well as the "dateNumericValue()" function.
In general, times needed to be converted to an integer in order to do calculations, and then maked as a glide_duration type field in order to be shown as a human-readable format.
http://wiki.service-now.com/index.php?title=Durations_and_personalize_calculations
Essentially, you're just setting a field attribute to "format=glide_duration" for display.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2008 11:45 AM
Hi, I want to reset a duration field to 0 and tried the above mentioned two ways but nothing seems to work.
First I tried :-
g_form.setDisplayValue('calendar_duration', '0 00:00:00');
Also tried to follow the instructions on the link:-
http://wiki.service-now.com/index.php?title=Duration_field_addition
Any suggestions on resetting the duration to 0 will be appreciated.
Thanks,
Shilpi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2008 09:50 AM
Are you trying to set the field via a Client Script, or a Business Rule? The syntax is different for both.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2008 11:30 AM
Hi,
Iam trying to do the samething right now.Iam trying to set the field via business rule.can you tell me the syntax for both the client script and the business rule?
Thanks