Highlighted
Outstanding Contributor.
Outstanding Contributor.
469 views

Duration Field value in Process Target is Invalid

Jump to solution

Hello experts,

I have a problem with this "Duration in Record":
I have created Process Target which is filled correctly in Incident:
SLO.JPGSLO_error.JPG

I have used script:

function ConvertDate(end, start){

var End = new Date(end)
var Start = new Date(start)
var Duration = End-Start
var Duration = Duration/1000/60

ConDuration= new XMLDate(Duration)
return ConDuration.getSCDateTimeString()
}

To store "time" inside of that field which for minutes look's like this '00:11:00' I have tried to push data like this '1 00:01:00' and it didn't accept it.
Does anyone know what could be the problem?
Best regards,
Dino

Labels (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Duration Field value in Process Target is Invalid

Jump to solution

Duration is some sort of "special case" of time calculations. To be honest, I never understood how it should be calculated by using JS code (maybe some type casting is required), so I've used a RAD application calendar.calc.interval.fc to calculate duration between start time and end time. Plus you've an opportunity to use calendar functionality to skip non-business hours (such as holidays).

Please see a following link, I think it may solve your problem too.

https://community.softwaregrp.com/t5/Service-Manager-Service-Center/How-to-check-if-a-date-is-was-within-service-hours/td-p/973486

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish

View solution in original post

1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Duration Field value in Process Target is Invalid

Jump to solution

Duration is some sort of "special case" of time calculations. To be honest, I never understood how it should be calculated by using JS code (maybe some type casting is required), so I've used a RAD application calendar.calc.interval.fc to calculate duration between start time and end time. Plus you've an opportunity to use calendar functionality to skip non-business hours (such as holidays).

Please see a following link, I think it may solve your problem too.

https://community.softwaregrp.com/t5/Service-Manager-Service-Center/How-to-check-if-a-date-is-was-within-service-hours/td-p/973486

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.