cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Referential Integrity error: while trying to delete a child object

kregimbald
12-Amethyst

Referential Integrity error: while trying to delete a child object

I received an error saying that I am unable to delete the "child" object because it is being used by another source. Basically an older version/iteration of the "child" is being used by another xml file. I am wondering if there is a way around this? Is there a way for me to delete ALL the child object's versions/iterations even though they are referenced by another source? None of the versions/iterations are required.

4 REPLIES 4

What kind of objects are you talking about? And what is the link?

Some EPMDocument relationships are more difficult to delete than other relationships like WTPart to WTPartmaster usage links, or WTPart to WTDocument links.

For example, if a WTPart Number 123 version A.1 uses WTPartMaster 456, but WTPart Number 123 version A.2 does not use WTPartMaster 456, then you cannot delete all versions of WTPartMaster 456 because it is used by that earlier iteration of WTPart Number 123 A.1. In that case, you have 3 options.

1. Use life cycle state, and/or a naming or numbering convention, and/or access control rules by location to any version(s) of WTPartMaster 456 to "Cancelled" or whatever communicates that it is no good.

2. Delete Version A of WTPart Number 123 (or even just delete the Non-latest Iterations of Version A), at which point you can now delete all versions of WTPartMaster 456. This is the best approach in most cases.

3. Write a custom, administrative "Delete" utility, like we did, that allows you to delete parts like 456 in the example, above, by using an API that safely bypasses the "uses" restriction, and other restrictions. If you go this route, then you have to be very, very careful not to corrupt any data; and you always have to remember that there is no "undo delete" in Windchill.

Al

We are working mainly with XML documents that have been linked to other XML documents. We want to remove the initial XML document without removing the XML files that are linked to it.

Kathleen,

Purge is your best chance to allow you to remove the older items from your System. We have managed to remove an entire Product Context's data (several thousand CAD docs) in the past, but it takes a bit of effort.

Rgds

Gary

Hi Kathleen,

We have actually written an article on the process around these Referential Integrity errors:

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS44609

Gary is right though it does take a bit of effort.

Hope this article helps you.

Thanks,

Jarrett

Announcements


Top Tags