Can someone help me with an AML query to find...
- all of our parts in Innovator that have only one item in the EBOM
- what revision sequence each part is assigned
- what the single EBOM item part number is
Don
Can someone help me with an AML query to find...
Don
Hi Don,
Is there a particular reason you're using AML for this task? Personally I'd write a short C# Method to gather this information.
The flow would look something like:
Let me know if that works!
AJ
AJ,
Thank you for your reply. Unfortunately, I am not familiar with C# or where I would even do that query.
I went ahead and whipped up a quick method which you can add to your instance and execute to get all the parts with exactly 1 BOM Relationship:
var inn = this.getInnovator();
var parts = inn.newItem("Part","get");
parts = parts.apply();
List<string> relPartList = new List<string>();
List<string> sourcePartList = new List<string>();
for (int i = 0; i < parts.getItemCount(); i++){
var currPart = parts.getItemByIndex(i);
var bomRel = inn.newItem("Part BOM","get");
bomRel.setProperty("source_id",currPart.getID());
bomRel = bomRel.apply();
if (bomRel.getItemCount() == 1){
relPartList.Add(bomRel.getProperty("related_id"));
sourcePartList.Add(currPart.getID());
}
}
return inn.newResult("Parts with 1 Item in EBOM: " + String.Join(",",sourcePartList));
To utilize this, you can create a new method in Innovator, make sure it's a server method. Then once it's saved you should be able to run the following action (Run Server Method):

The output should pop up. It'll be a list of IDs for all the parts that have exactly 1 BOM Relationship. After that you should be able to use that list for an AML Query using the idlist attribute.
AJ
I went ahead and whipped up a quick method which you can add to your instance and execute to get all the parts with exactly 1 BOM Relationship:
var inn = this.getInnovator();
var parts = inn.newItem("Part","get");
parts = parts.apply();
List<string> relPartList = new List<string>();
List<string> sourcePartList = new List<string>();
for (int i = 0; i < parts.getItemCount(); i++){
var currPart = parts.getItemByIndex(i);
var bomRel = inn.newItem("Part BOM","get");
bomRel.setProperty("source_id",currPart.getID());
bomRel = bomRel.apply();
if (bomRel.getItemCount() == 1){
relPartList.Add(bomRel.getProperty("related_id"));
sourcePartList.Add(currPart.getID());
}
}
return inn.newResult("Parts with 1 Item in EBOM: " + String.Join(",",sourcePartList));
To utilize this, you can create a new method in Innovator, make sure it's a server method. Then once it's saved you should be able to run the following action (Run Server Method):

The output should pop up. It'll be a list of IDs for all the parts that have exactly 1 BOM Relationship. After that you should be able to use that list for an AML Query using the idlist attribute.
AJ
Running the AM idlist attribute gave me all the part numbers with only one eBOM item but I still don't have the part number or ID of the single eBOM item. Did I miss something?
If you want to get the related Items I'd recommend something like this
<Item type="Part" id="ACBDEF0123456789…" action="get">
<Relationships>
<Item type="BOM" action="get"/>
</Relationships>
</Item>
(This sample is directly from the Programmers Guide, which you should check out for AML tips)
This will show the relationship and should give you information about the related part.
AJ,
Thank you so much for all your help!
-Don
Copyright © 2025 Aras. All rights reserved.