Skip to main content
17-Peridot
June 18, 2020
Solved

How do I add an action only for a document subtype?

Hello everyone, please tell me how to add an action to the "Actions" button for only one subtype of the document WTDocument?

hlafkirAnswer
5-Regular Member
June 18, 2020

Hi

You may check for the property menufor described here :

Defining New Action Model

focus on the "menufor" keyword this point.

 

Just be aware of the article : CS312920 if this not work, a pre-validation is required.

 

Sample Code
The following is sample code for an action model that configures a subtype:
<!-- Copied from ChangeManagement-actionModels.xml -->
<!-- Originally copied from menu for wt.change2.WTChangeRequest2 -->
<model name="sample change request actions" menufor="WCTYPE|
wt.change2.WTChangeRequest2|org.default.www.SampleChangeRequest">
<action name="view" type="object"/>
<action name="SETLIFECYCLESTATE" type="pdmObject"/>
<action name="createSubscription" type="subscription"/>
<action name="separator" type="separator"/>
<action name="reviseChangeItems" type="change"/>
<action name="editCapabilityPackage" type="capabilityPackage"/>
<action name="create" type="approach" />
<action name="create" type="capabilityImplementationProject" />
<action name="separator" type="separator"/>
<action name="sandboxAddToProject" type="object"/>
<action name="SBAddToPrj" type="sandbox"/>
<action name="removeShare" type="object"/>
<action name="separator" type="separator"/>
<action name="ManageSecurity" type="accessPermission"/>
<action name="renameObjectWizard" type="object"/>
<action name="delete" type="object"/>
<action name="separator" type="separator"/>
<action name="separator" type="separator"/>
<action name="discuss" type="forum"/>
<action name="copy" type="object"/>
</model>
 
good luck !

4 replies

1-Visitor
June 18, 2020

You need to implement your own custom validator or filter.

 

Translate
hlafkir5-Regular MemberAnswer
5-Regular Member
June 18, 2020

Hi

You may check for the property menufor described here :

Defining New Action Model

focus on the "menufor" keyword this point.

 

Just be aware of the article : CS312920 if this not work, a pre-validation is required.

 

Sample Code
The following is sample code for an action model that configures a subtype:
<!-- Copied from ChangeManagement-actionModels.xml -->
<!-- Originally copied from menu for wt.change2.WTChangeRequest2 -->
<model name="sample change request actions" menufor="WCTYPE|
wt.change2.WTChangeRequest2|org.default.www.SampleChangeRequest">
<action name="view" type="object"/>
<action name="SETLIFECYCLESTATE" type="pdmObject"/>
<action name="createSubscription" type="subscription"/>
<action name="separator" type="separator"/>
<action name="reviseChangeItems" type="change"/>
<action name="editCapabilityPackage" type="capabilityPackage"/>
<action name="create" type="approach" />
<action name="create" type="capabilityImplementationProject" />
<action name="separator" type="separator"/>
<action name="sandboxAddToProject" type="object"/>
<action name="SBAddToPrj" type="sandbox"/>
<action name="removeShare" type="object"/>
<action name="separator" type="separator"/>
<action name="ManageSecurity" type="accessPermission"/>
<action name="renameObjectWizard" type="object"/>
<action name="delete" type="object"/>
<action name="separator" type="separator"/>
<action name="separator" type="separator"/>
<action name="discuss" type="forum"/>
<action name="copy" type="object"/>
</model>
 
good luck !
Translate
VladiSlav17-PeridotAuthor
17-Peridot
June 18, 2020

 

hlafkir ,Thank you very much, this is what you need
Translate
4-Participant
September 13, 2024

Hi VladiSlav, did this work for you?? i tried the same for one of the document subtype dint work, so need your suggestion

Translate