I have a workflow with a string field that I want to offer as a dropdown of results from a SQL database. I've created an action to query the database that is passed a SQL:Database value. The action script is below:
// DO query on MGMTDB
var results = new Array();
var SingleResult;
var query = "SELECT TemplateOS,TemplateVersion FROM TableName";
var QueryResults = MGMTDB.readCustomQuery(query);
for each (SingleResult in QueryResults)
{
var template = SingleResult.getProperty("TemplateOS") + " " + SingleResult.getProperty("TemplateVersion");
//System.debug("getTemplateNames:: " + template);
results.push(template);
}
return results;
However, as soon as I add the action to a presentation property, the workflow spends an eternity "processing presentation". The action itself works quickly enough. I added it to a test workflow as part of its schema and I get the desired array of strings back instantly. It's only when it's being used for presentation that it's giving me a problem.
Anyone have any ideas what's going on?