Skip to main content
15-Moonstone
September 27, 2017
Solved

Attaching a selected Document sub type to a Part

  • September 27, 2017
  • 1 reply
  • 1713 views
Hi All, I would like to know the solution for a scenario listed below. Please let me know what can be done to solve the same. Say for WTDocument there are 3 soft types like ADocument, BDocument and CDocument, and if I had to attach only BDocument to WTPart and not ADocument or CDocument. How would I be doing it ? In case if i try attaching ADocument or CDocument an error should pop up saying that only BDocument can be attached. How to customize the above solution ? Is it using events, listeners or form processor or by any other means ? Can anyone please let me know about the same. Thanks in advance. Best Regards, Aditya
Best answer by JeffZemsky

There is no need to customize - configuring the Relationship constraint will give you this behavior.  Once you configure you will only be able to relate the defined subtypes and not other subtypes.  The UIs used while relating will only let you select Docs of the appropriate type.

1 reply

17-Peridot
September 28, 2017

Please check out Relationship Constraints.  They will allow you to configure which types of objects can be used in relationships.  For Part to Doc be sure to look at whether its a Describes or Reference relationship you want to configure.

 

Check out this section of help:  Relationship Constraints Tab

aachanta15-MoonstoneAuthor
15-Moonstone
October 5, 2017
Hi Jeff, Thanks for the reply. I had gone through the link. But can we customize it in Windchill like for a WTPart only a selected document subtype can be attached and others should not be attached. So if there is any API or code regarding the same do request you to share the same. Thanks and Regards, Aditya
17-Peridot
October 5, 2017

There is no need to customize - configuring the Relationship constraint will give you this behavior.  Once you configure you will only be able to relate the defined subtypes and not other subtypes.  The UIs used while relating will only let you select Docs of the appropriate type.