Forum Discussion
Hello, Thanks for your answer but the AML respond is not compliant to the need :
why :
If you have
- itmSource1 (generation=1, Is_released=1, is_current=0 ) linked to Relation1
- itmSource2 (generation=2, Is_released=0, is_current=1 ) linked to Relation2
Regarding the example, I would like to retrieve Relation1 (linked to itmSource1 at Is_released=1).
But is_current=0 because is not the latest generation
Normlaly, you can filter it by using queryType="Released", but not in sub AML request..(except I made an error) :-)
Hi Breton
Assuming below example: When you use only is_released = "1", it is always pointing to itmSource1 in the query
- itmSource1 (generation=1, Is_released=1, is_current=0 ) linked to Relation1 and you would like to retrieve Relation1 of this
<AML>
<Item action="get" type="Relation">
<source_id>
<Item action="get" type="itmSource" where="[itmSource].is_released ='1'">
</Item>
</source_id>
</Item>
</AML>
Output of this query is
Relationship that connects itmSource in Released State or In Change State as source item and tmRelated as related item
- Gopikrishnan4 years agoAccelerator II
Assuming below example:
- itmSource1 (generation = 1, Is_released = 0, is_current = 0) linked to Relation 1
- itmSource1 (generation = 2, Is_released = 0, is_current = 0) linked to Relation 2
- itmSource1 (generation = 3, Is_released = 1, is_current = 0) linked to Relation 3
- itmSource1 (generation = 4, Is_released = 0, is_current = 1) linked to Relation 4Below Query Output is Relation 3
<AML>
<Item action="get" type="Part BOM">
<source_id>
<Item action="get" type="Part" orderBy="generation" where="[Part].is_released ='1' AND is_current ='0'">
</Item>
</source_id>
</Item>
</AML>Below Query Output is Relation 4
<AML>
<Item action="get" type="Part BOM">
<source_id>
<Item action="get" type="Part" orderBy="generation" where="[Part].is_released ='0' AND is_current ='1'">
</Item>
</source_id>
</Item>
</AML>Below Query Output is Relation 1 and Relation 2
<AML>
<Item action="get" type="Part BOM">
<source_id>
<Item action="get" type="Part" orderBy="generation" where="[Part].is_released ='0' AND is_current ='0'">
</Item>
</source_id>
</Item>
</AML>- Breton4 years agoIdeator III
hello, my context is like that
- itmSource1 (generation = 1, Is_released = 1, is_current = 0) linked to Relation 1
- itmSource1 (generation = 2, Is_released = 1, is_current = 0) linked to Relation 2
- itmSource1 (generation = 3, Is_released = 1, is_current = 0) linked to Relation 3
- itmSource1 (generation = 4, Is_released = 0, is_current = 1) linked to Relation 4
Because I "validate" my ITEM each time before revising.
So you have Is_released = 1 severla time- Gopikrishnan4 years agoAccelerator II
Hi,
If this is the case, below query will give the Relation1, 2 and 3
<AML>
<Item action="get" type="Relation">
<source_id>
<Item action="get" type="itmSource" where="[itmSource].is_released ='1' AND [itmSource].is_current ='0'">
</Item>
</source_id>
</Item>
</AML>However, if you want only Relation 3 then try with below
<AML>
<Item action="get" type="Relation">
<source_id>
<Item action="get" type="itmSource" where="[itmSource].is_released ='1'" orderBy="generation DESC" maxRecords="1">
<generation condition="gt">0</generation>
</Item>
</source_id>
</Item>
</AML>