I need some help creating a vCAC entity using the vCAC plugin. Here is the code snippet that I use:
// Inputs: host, entitySetName, propertyNames[], propertyValues[]
var modelName = 'ManagementModelEntities.svc';
var links = null;
var headers = null;
var inputProperties = new Properties();
for (var i = propertyNames.length - 1; i >= 0; i -= 1) {
inputProperties.put(propertyNames[i], propertyValues[i]);
}
var rEntity = vCACEntityManager.
createModelEntity(host.id, modelName, entitySetName, inputProperties, links, headers);
if (rEntity == null) {
throw "Unable to create " + entitySetName + " entity";
}
else {
System.log("Created " + entitySetName + " entity");
}
However, this snippet fails with the following error:
Unable to convert java.lang.String into org.joda.time.LocalDateTime (Workflow:CreateEntity / Create Entity (item1)#11)
I then tried with the following lines but with no luck:
inputProperties.put('CreatedDate', new org.joda.time.LocalDateTime(1972, 12, 3, 0, 0));
inputProperties.put('LastModifiedDate', new org.joda.time.LocalDateTime(1972, 12, 3, 0, 0));
I am having trouble finding a way to specify values for these two properties: CreatedDate & LastModifiedDate (the datatype being: org.joda.time.LocalDateTime).
Appreciate any help.