Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: How to delete the primarycontent of teh Document using api.

$
0
0

Following works with Windchill 10.2 M10

 

private boolean removePrimaryContent(final WTDocument wtDoc) {

                    boolean isSuccess = false;

                    ContentItem contentItem = null;

                    try {

                              contentItem = ContentHelper.service.getPrimary((FormatContentHolder)wtDoc);

 

                              if(contentItem != null){

                                        System.out.println("deleting contentItem: " + contentItem.getDisplayIdentity());

                                        PersistenceHelper.manager.delete(contentItem);

                                        isSuccess = true;

                              }

                    } catch (WTException | PropertyVetoException e) {

                              isSuccess = false;

                              e.printStackTrace();

                    }

 

                    return isSuccess;

          }


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>