Find parent of any child item which is being used by the BOM of a Affected Item on a Pending Change Order

One of the constraints to deleting a Part is that it must not be on the BOM of another Part. If the Parent Part has been released, the Child Part’s Where Used table shows the Parent Part. However, if the Parent Part is on a Pending Change Order, and that Parent’s BOM has a Redline Add Part of the Child Part, it prevents the Child Part from being Deleted.

Is there any way in the API, given a Part, to see if it is the Child of any Part on a Pending Change Order? It works fine if the Change Order is Released, just not in Pending.

Part A (Introductory)

Build Change Order (123)
    Affected Items:
        Part A (REV A)
            BOM
                Part B

Part B (Introductory)
   Where Used
       (Empty)

If I have Part B, how do I figure out that it is being used by Part A’s BOM on a Pending Change Order?

Add Comment
2 Answer(s)

Not from the API, that I am aware of.  Since the change/assembly revision is not yet released, it is useless to show a component as being used because it might be removed before the assembly BOM is released.

 A query in the database would be as follows :
select i.item_number ASSEMBLY, b.item_number COMPONENT
 from bom b, item i
 where b.item  = i.id and b.change_in > 0
     and exists (select null from change where id = b.change_in and statustype < 3)
     and b.item_number = <item you are interesting in>;

Agile Angel Answered on October 8, 2018.

I’ll give this a try. The issue here is that one cannot remove an Item if it is being used in as a child in a non-released Part’s BOM. So in that sense, the Agile System _does_ consider it being used for deletion purposes as it refuses to delete it. We’re trying to validate that a Item can be properly deleted, and thus need to know if it’s being used in the BOM of a AI on a Pending Change Order.

The API and the UI throws an exception if you try to delete the Part in this case. I had hoped there was some common way of searching the same way the constraint validation does internally.

Is there any API Query (IQuery.OBJECT_TYPE) that can be ran? 

on October 8, 2018.
Add Comment
Best answer

Hello

 The API has TABLE_PENDINGCHANGEWHEREUSED as one of the tableconstants. You should be able to use this to get the parents that is using this child and not yet released

Agile Angel Answered on October 8, 2018.

That was exactly what I needed. I’m not sure why I missed it. Thank you.

on October 8, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.