<AML> <Item type="Part" action="get"> <generation condition="gt">0</generation> </Item></AML>
Additionally, in recent versions of Innovator, SELECT statements are blocked from use in where clauses due to security concerns. Typically an error is thrown indicating this. Could you please provide the full AML query that you are using?
That being said, the most recent generation of an Item is always flagged with the "is_current" boolean, so you can perform the same query for an item with the highest generation by using the AML below.
<AML><AML> <Item type="Part" action="get"> <is_current>1</is_current> </Item></AML>
I also want to note that, by default, only the most recent generation of an Item is returned in an AML search unless you are specifically querying on the generation property.
Chris
_________________________
Christopher Gillis
Aras Labs Software Engineer<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 EngineerCopyright © 2024 Aras. All rights reserved.