Need help with AML query to connect two independent ItemTypes via referencing item

Hi community,

I am working on an AML query but cannot find a proper solution. It contains a lot of custom ItemTypes, but technically the query would work similar like this:

START--------> Part 
---------------------> Part BOM
--------------------------> Part
<------------- MyCustomItemType (part_id) <-------- GOAL is to get properties of this referencing item

We start from Part and go downwards to get the complete BOM. Easy.

Now I have a second independent ItemType "MyCustomItemType" that also uses Part inside an item property. I want to include this custom ItemType to the query to fetch some additional data. In my case the end result shall combine BOM information with warehouse specific data. 

Problem: "MyCustomItemType" is not included in the "natural downward path" of Parts. And I want to avoid to include it at all costs. The data is federated and shall only be fetched on demand. So we have only a true reference from "MyCustomItemType" to Part, but no real reference form "Part" to "MyCustomItemType". 

Question: How can I get the data of MyCustomItemType when we start from the top part? Is this possible at all?

Interesting detail: When we use a Query Definition these kind of "inverted" queries would be possible by "using referencing item". Is something similar possible with plain AML?

Thanks for any hint!

Angela

Parents
  • Hi Angela,

    AML itself doesn’t really have the joining capability you’d need here. A query definition would probably be the simplest approach to this type of query.

    If you can’t use a QD in this scenario, I’d try creating a custom server method to use as an AML action. 

    <Item type=“Part” action=“GetBomWarehouseData” id=“...” />

    That approach would enable you to include any additional you need in the AML response.

    Out of curiosity - do you have any constraints preventing you from using a Query Definition in this scenario? 

Reply
  • Hi Angela,

    AML itself doesn’t really have the joining capability you’d need here. A query definition would probably be the simplest approach to this type of query.

    If you can’t use a QD in this scenario, I’d try creating a custom server method to use as an AML action. 

    <Item type=“Part” action=“GetBomWarehouseData” id=“...” />

    That approach would enable you to include any additional you need in the AML response.

    Out of curiosity - do you have any constraints preventing you from using a Query Definition in this scenario? 

Children
No Data