deleting referenced files

Discuss SolidWorks PDM
User avatar
mp3-250
Posts: 540
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 601
x 282

deleting referenced files

Unread post by mp3-250 »

What is the best way to delete permanently a document that is pasted as reference on a 3d file (e.g. pdf over a sldprt) and not included In boms, but only referenced?
to add the reference the cad file must be checkout, but if I permanently delete the document from the archive are all the records in the db deleted as well or I have to check out all the cad files where the document is used and remove the reference?
by Diaval » Thu Dec 14, 2023 6:00 pm
mp3-250 wrote: Thu Dec 14, 2023 4:56 pm this is what i hoped for, but does it works as advertised or the DB will be littered with broken references?
do you know which db table I shoud check to be sure?
Yes this does work correctly. :)

All file to file reference relations are stored in the XRefs table. The parent file would be the DocumentID and the referenced file is the XRefDocument.

When you delete a file in the PDM vault (delete, not destroy), the file record is still kept in the Documents table and flagged as deleted which puts it into the PDM recycle bin. All other tables still maintain any references to this document in case the file is restored from the recycle bin. But when a file is destroyed, the record in the Documents table is deleted and all other tables that refer to this document are updated to remove those references in the database, including the XRefs table that keeps the file to file reference relations.

You may not see the file removed from the physical archives immediately. That operation is run once a day (at 3am by default) as the clean up that will look for files that are no longer in the documents table and delete the physical archives for those files.
Go to full post
User avatar
Diaval
Posts: 87
Joined: Wed Mar 17, 2021 12:01 pm
Answers: 7
Location: Stockholm
x 50
x 110

Re: deleting referenced files

Unread post by Diaval »

mp3-250 wrote: Fri Nov 17, 2023 4:18 am What is the best way to delete permanently a document that is pasted as reference on a 3d file (e.g. pdf over a sldprt) and not included In boms, but only referenced?
to add the reference the cad file must be checkout, but if I permanently delete the document from the archive are all the records in the db deleted as well or I have to check out all the cad files where the document is used and remove the reference?
Paste as reference relations are only kept in the PDM database and are not stored anywhere inside the CAD file. If you destroy the file from the vault, the reference information will be removed from the database without the need to check out or resave the cad documents.
-- To espouse elucidation we must eschew obfuscation
User avatar
mp3-250
Posts: 540
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 601
x 282

Re: deleting referenced files

Unread post by mp3-250 »

Diaval wrote: Thu Dec 14, 2023 4:26 pm Paste as reference relations are only kept in the PDM database and are not stored anywhere inside the CAD file. If you destroy the file from the vault, the reference information will be removed from the database without the need to check out or resave the cad documents.
this is what i hoped for, but does it works as advertised or the DB will be littered with broken references?
do you know which db table I shoud check to be sure?
User avatar
Diaval
Posts: 87
Joined: Wed Mar 17, 2021 12:01 pm
Answers: 7
Location: Stockholm
x 50
x 110

Re: deleting referenced files

Unread post by Diaval »

mp3-250 wrote: Thu Dec 14, 2023 4:56 pm this is what i hoped for, but does it works as advertised or the DB will be littered with broken references?
do you know which db table I shoud check to be sure?
Yes this does work correctly. :)

All file to file reference relations are stored in the XRefs table. The parent file would be the DocumentID and the referenced file is the XRefDocument.

When you delete a file in the PDM vault (delete, not destroy), the file record is still kept in the Documents table and flagged as deleted which puts it into the PDM recycle bin. All other tables still maintain any references to this document in case the file is restored from the recycle bin. But when a file is destroyed, the record in the Documents table is deleted and all other tables that refer to this document are updated to remove those references in the database, including the XRefs table that keeps the file to file reference relations.

You may not see the file removed from the physical archives immediately. That operation is run once a day (at 3am by default) as the clean up that will look for files that are no longer in the documents table and delete the physical archives for those files.
-- To espouse elucidation we must eschew obfuscation
User avatar
mp3-250
Posts: 540
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 601
x 282

Re: deleting referenced files

Unread post by mp3-250 »

The other day I got the official answer from SW via our VAR: they say the only supported way is to check out every single file and uncheck the reference.

Honestly it is unfeasable for administrative purposes and that answer is only though for a normal user workflow...
Post Reply