I am trying to develop an action i can call as part of one of my workflow that will return a list of vcac:virtualmachines based on a filter i provide so the client get a drop down list to choose from. The problem i am have is that my code below works find if i provide the whole vm name but doesnt return anything if i use a partial name. Eventually i will provide another filter to filter by business group as well but i am working up to that. What am i doing wrong?
The whole server name:
"ap-script-p001"
Test code:
var Pattern = 'ap-script'; var vms = Server.findAllForType("vCAC:VirtualMachine", "substringof(VirtualMachineName, '" + Pattern + "') eq true") for each (var vCACVirtualMachine in vms) { System.log("name:"+vCACVirtualMachine.VirtualMachineName); }
with the code above nothing comes back
With the whole name it returns the object. I want to be able to enter a partial name and the client can choose their specific box for a drop down.