How to get the workflow of a change item programmatically?

Hi, I want to run the following client code from an Express ECO button event:
var innovator = new Innovator(); 

var thisItem = document.thisItem;
var id = thisItem.getID(); // id of Express ECO

// here should be the code that fetches the Workflow Process id.

var qryItem = innovator.newItem(); 
qryItem.loadAML( 
"<Item type='Workflow Process' id='/*----missing ID----*/' initial_action='get' action='do_l10n' select='state, name,related_id(name)' >" +
              "<Relationships>" +
                "<Item type='Workflow Process Activity' action='get' select='related_id'>"+
                  "<related_id>" +
                  "<Item type='Activity' action='get' select='name,related_id(name)'>" +
                    "<state condition='ne'>Pending</state>" +
                    "<Relationships>" +
                      "<Item type='Activity Assignment' action='get' select='related_id' >" +
                         "<related_id type='Identity' select='keyed_name' />" +
                      "</Item>" +
                    "</Relationships>" +
                  "</Item>" +
                  "</related_id>" +
                "</Item>" +
              "</Relationships>" +
            "</Item>"
); 
var resultItem = qryItem.apply(); 
Unfortunately I wan´t able to find the missing link between the Express ECO and the corresponding Workflow Process yet. Can you give me a hint how the two are connected? Thanks again! Angela
Parents
  • Hi Angela, I believe Mahmoud is correct. The related_id(name) in your select statement is asking for only the name property of the related item to be returned. You canreturn multiple properties from the related item by separating them with commas like this related_id(name, related_id). Chris ______________________________________ Christopher Gillis Aras Labs Software Engineer
Reply
  • Hi Angela, I believe Mahmoud is correct. The related_id(name) in your select statement is asking for only the name property of the related item to be returned. You canreturn multiple properties from the related item by separating them with commas like this related_id(name, related_id). Chris ______________________________________ Christopher Gillis Aras Labs Software Engineer
Children
No Data