Forum Discussion
Hi Hyder,
You can check out the first section of this blog post on special aml actions for an example how to perform a recursive AML query which should help you get all of the Activities that you're looking for.
Chris
Christopher Gillis
Aras Labs Software Engineer
I tried something similar like this. But did not provide any result .(I am using 12Sp3)
<AML>
<Item type="prj_Phase" action="GetItemRepeatConfig" select ="id" >
<id>Test_id</id>
<Relationships>
<Item type="prj_Phase Activity" action="get" select="related_id" >
<related_id>
<Item type="prj_Activity" action="get" select="state,name" ></Item>
</related_id>
</Item>
<Item type="prj_Phase Child_Phase" action="get" select="related_id" >
<related_id>
<Item type="prj_Phase" repeatProp="related_id" repeatTimes="0" action="get" select="id" >
<Relationships></Relationships>
</Item>
</related_id>
</Item>
</Relationships>
</Item>
</AML>
- christopher_gillis6 years agoNew Member
Hello,
The syntax for this action can be picky. Try using the syntax below instead.
<AML><Item type="prj_Phase" select="id" action="GetItemRepeatConfig" id="YOUR_PART_ID"><Relationships><Item type="prj_Phase Child_Phase" select="related_id" repeatProp="related_id" repeatTimes="0" /><Item type="prj_Phase Activity" action="get" select="related_id(state,name)" /></Relationships></Item></AML>Note that for simplicity, I've also condensed the query for the prj_Phase Activity relationship. You can query for data from an item property by including an additional set of property names in parentheses inside of your select statement. In this example, I'm getting the state and name properties from the item stored in the related_id by using related_id(state,name). This extra bit isn't necessary for the GetItemRepeatConfig action, but minimizing the size of the queries you write can make it easier to work with them.
Chris
- ARAS_User6 years agoIdeator I
Query is only finding "Activity" which are in parent Phase. It is not able to find Activity inside the 3rd level Child phase. There is no Activity in 2nd levels, only phases..See below representation
Phase Activity1 Activity2 Phase 1 Phase1a Activity3 Activity4 Phase1b Activity5 Activity6 - christopher_gillis6 years agoNew Member
Hello,
Could you post the AML that you're using now? I tested this in a local instance with a similarly formatted Part BOM and Part Document structure, but I was able to get all of the items I expected.
Chris