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

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

TranB
4-Participant

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
bmr
17-Peridot
17-Peridot
(To:TranB)

@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.

View solution in original post

4 REPLIES 4
bmr
17-Peridot
17-Peridot
(To:TranB)

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.

 

TranB
4-Participant
(To:bmr)

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

bmr
17-Peridot
17-Peridot
(To:TranB)

@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.

View solution in original post

TranB
4-Participant
(To:bmr)

Hi bmr, 

Thank you very much for your tips.   

Best Regards, 

-Boi

Announcements