Forum Discussion

Mithun's avatar
Mithun
Ideator III
7 years ago
Solved

How can we retrieve Orphan Parts or Parts with no relation from Database?

I mean how can we get all the parts in the system that are not related to any Assembly, they are just components bearing no relation to any other part what so ever. We can fetch such parts by makin...
  • Hi Mithun,

    The easiest way to do this would be to create a Query Definition that returns parts matching your criteria. I can think of three different conditions to check to find the "orphan parts" in your system.

    1. The classification of the Part is not equal to 'Assembly'
    2. The Part has no Part BOM relationships
    3. The Part is not the related_id of any existing Part BOM relationships in the system

    If you haven't used query definitions before, you can check out our Introductory blog. Additionally, if you need to do anything with the orphan parts returned, you can check out this blog post on using query definitions inside your method code.

    Chris

    Christopher Gillis

    Aras Labs Software Engineer