Forum Discussion
I think I am close, I have the following:
<Item type="Part BOM" action="delete" where="Part_BOM.source_id='@1'"></Item>
The parent part number I am reading from a file, first column. I am not getting errors during execution, but the part BOM is still there (the command did not delete the BOM, I can still see it in the part). I think this line makes perfect sense so I will look into it again and see if I missed anything. I also tried the following script:
<!-- To delete a complete BOM, round 2, no errors but not working -->
<Item type="Part" where = "item_number = '@1' and is_current = '1' " action="edit">
<Relationships>
<Item type = "Part BOM" action = "delete" where="Part_BOM.source_id='@1'"></Item>
</Relationships>
</Item>
Should I change my approach, or am I on the right track?
Hi Pmateo
It should be on opposite way. You need to use the related_id. (Source ID is ID of Parent Part and Related ID is ID of Child Part)
Example:
Parent1 --> Child1
Parent2 --> Child1
If you want to delete Child1 in Parent1 and Parent2. Use below query
<AML>
<Item action='delete' type='Part BOM' where="[Part_BOM].related_id='773D6786B7DE48439F373F59'"></Item>
</AML>
Here Related ID is ID of the Child1.
Hope it helps.
Thank You
Gopikrishnan