So I'm looking at the available pieces that I can put together in a workflow schema and I see that there is one labeled "Add hours to date" so I thought I would give it a try. The code that is uses is as follows:
//Auto-generated script
if (aDate != null) {
aDate.addHours(hours) ;
}
else {
throw "'aDate' is NULL";
}
When I try and use this I get the following error:
TypeError: Cannot find function addHours. (Workflow:New workflow / Add hours to date (item2)#2)
I've searched the API and there does not seem to be any sort of addHours method. Is this a known problem? Am I missing a plugin?
Thanks!
Colin J.
Definitely a bug. Never caught this one in 4 years of vCO use. Actualy I never noticed the box ...
Please report it to VMware Global Support Services.
Christophe.
I tested this and got the same result as you did, there is no method of 'addHours' :smileyconfused:
I'm using vCO 4.1.1 build 733
In the event you need a workaround, create a new scriptable task with the same inputs and outputs and use this code:
if (aDate != null) {
//aDate.addHours(hours) ;
aDate.setHours(aDate.getHours() + hours);
}
else {
throw "'aDate' is NULL";
}
Glad to finally get a chance to give back to the community!
-Bobby
Definitely a bug. Never caught this one in 4 years of vCO use. Actualy I never noticed the box ...
Please report it to VMware Global Support Services.
Christophe.
Hi all,
Just letting you know that this has been identified as a bug by VMware Support.
Thanks for the update and for submitting it.
This will help the product to be better.
Christophe.
WOOHOO! My first bug! :smileysilly: