Forum Discussion
christopher_gillis
9 years agoCommunity Manager
Hello,
By default, the generation property does not reset whenever an Item's major_rev is increased. Instead, we can take advantage of the fact that the major_rev property is increased whenever an item is edited from a Released state. Because of this, we can run the AML query below to look for only the latest generation of each Major Revision of an item.
<AML>
<Item type="Part" action="get">
<state>Released</state>
<generation condition="gt">0</generation>
</Item>
</AML>
Note, that we query using the generation tag in the AML in order to return all instances of a Part, not just the most current version.
As a general practice, we recommend against using direct SQL in a Method as it bypasses the Aras permission model.
Lastly, could you please provide the scenario where your item is not incrementing the major_rev?
Chris
____________________________________
Christopher Gillis
Aras Labs Software Engineer