How to add two duration fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2014 06:19 AM
Hi All,
On Incident page, we have Time Card entry tab. And on that there is Duration field which is getting calculated from two other fields as Start Time and End Time. Therefore suppose a single incident should have multiple Duration added. Now on incident there is Total Duration field where i would like the addition of all these Duration for Time Card entries. Can anyone please let me know how can i do it?
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 01:21 AM
I will need to check on an instance but I'm sure durations are stored as numeric values so should be able to use simple + - etc or > <
easy way to find out is get the tool to print what it's seeing in those fields by either using
gs.log(current.u_duration_field);
gs.addInfoMessage(current.u_duration_field);
if they are not numeric values then there are ways to convert them like .getNumericValue() but I'm pretty sure they are stored as a numeric value. will confirm when I'm near an instance again today.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 01:31 AM
Does you meant to say to get the value of Duration field through gs.addInfoMessage(current.u_duration_field.getDisplayValue()); I tried with that however its not returning anything i tried with getValue() too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 01:32 AM
I used :- gs.addInfoMessage('Hello :' + current.u_duration_field.getDisplayValue());
Its returing Hello : Undefined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 02:10 AM
How about current.u_duration_field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 02:19 AM
I tried but it didn't display anything.
