Skip to main content
1-Visitor
October 6, 2021
Solved

How to limit a number of roleB item added to a Configurable Link table?

  • October 6, 2021
  • 1 reply
  • 2356 views

Hi Windchill Guru's, 

Is it possible to limit only one roleB item added to a Configurable Link table.   What customization/configuration do I need to do?

Thank you, 

-Boi

Best answer by BjoernRueegg

@TranB 

You need to program an action validator filter which extends the class DefaultSimpleValidationFilter

See CS299819 

 

Then you need to find the action located in %WT_HOME%/codebase/config/actions/...actions.xml. You can also find the action with the client customization enabled in the preference manager. Or add at the end of the url &jcaDebug=true. You need to figure out the name of the action.

Afterwards copy the defined action to the custom-actions.xml file and add your new filter to it. E.g.

 

 <objecttype name="object" 
 	resourceBundle="com.ptc.windchill.enterprise.object.configurableLinkObjectResource">

 <action name="configurableLink_add" ajax="component">
	 <includeFilter name="hideForNewObjectInWorkspace"/>
	 <includeFilter name="hideForCheckedoutObjectInWorkspace"/>
 <!--Add your custom filter here -->
 <includeFilter name="CUSThideForMultipleLinks"/>
 		<command class="com.ptc.windchill.enterprise.object.forms.ConfigLinkAddRelationFormProcessor"
	 	method="execute" windowType="popup"/>
 </action>
</objecttype>

 Don't forget to reload the actions or restart windchill.

1 reply

17-Peridot
October 6, 2021

Probably the easiest way would be an action validator (filter). Enable the action if there is no object in the table, disable the action if there is already an object inside.

 

TranB1-VisitorAuthor
1-Visitor
October 6, 2021

Hi "bmr", 

 

Thanks for your reply.  I'm new to WC customization.  Could you please spread some more light on "action validator" filter?

What customization is needed to disable the "+" and the "Create New" action in table:  

ConfigurableLinkTable.png

Thanks, 

-Boi

17-Peridot
October 7, 2021

@TranB 

You need to program an action validator filter which extends the class DefaultSimpleValidationFilter

See CS299819 

 

Then you need to find the action located in %WT_HOME%/codebase/config/actions/...actions.xml. You can also find the action with the client customization enabled in the preference manager. Or add at the end of the url &jcaDebug=true. You need to figure out the name of the action.

Afterwards copy the defined action to the custom-actions.xml file and add your new filter to it. E.g.

 

 <objecttype name="object" 
 	resourceBundle="com.ptc.windchill.enterprise.object.configurableLinkObjectResource">

 <action name="configurableLink_add" ajax="component">
	 <includeFilter name="hideForNewObjectInWorkspace"/>
	 <includeFilter name="hideForCheckedoutObjectInWorkspace"/>
 <!--Add your custom filter here -->
 <includeFilter name="CUSThideForMultipleLinks"/>
 		<command class="com.ptc.windchill.enterprise.object.forms.ConfigLinkAddRelationFormProcessor"
	 	method="execute" windowType="popup"/>
 </action>
</objecttype>

 Don't forget to reload the actions or restart windchill.