Skip to main content
6-Contributor
Mar 12, 2024 12:18 PM UTC
Solved

Grayed out OOTB actions when WTPart type object NOT having "Resulting Change Exists" indicator

Grayed out below OOTB four action buttons when WTPart type object NOT having "Resulting Change Exists" indicator.

OOTB Action buttons to be grayed out :

1)Check Out

2)Check Out and Edit

3)Edit

4)Edit Common Attributes.

 

Which is best way to Grayed out OOTB action buttons:

1)Filters

2)Validators

HelesicPetr
22-Sapphire II
Mar 12, 2024 2:22 PM UTC

Hi @V_THAKARE 

You asked for a custom function that disables the actions from menu if the object is not part of a change result table.

Understand.

So you ask for Filter or Validator, It is a same thing

Validator is a class where code is written and filter is a xml parameter in the customAction.xml file that points to the validator class

ps the com.ptc.core.ui.validation.DefaultSimpleValidationFilter is extendable class that can be used. 

 

so your requirement is doable with validator/filter. 

 

PetrH. 

6 replies

jbailey
18-Opal
Mar 12, 2024 12:28 PM UTC

The actions available on an object should be based on ACL's and a user's role in a team and the lifecycle state of the objects

 

If the object is not resulting from a change, and is in a final state (ex released)... then only Change Admin II or an org/site admin would see those.

Translate
V_THAKARE6-ContributorAuthor
6-Contributor
Mar 13, 2024 12:57 PM UTC

But I want to add some other users/groups apart from Change Admin II or an org/site admin.

What is your opinion.

Translate
HelesicPetr
22-Sapphire II
Mar 12, 2024 2:22 PM UTC

Hi @V_THAKARE 

You asked for a custom function that disables the actions from menu if the object is not part of a change result table.

Understand.

So you ask for Filter or Validator, It is a same thing

Validator is a class where code is written and filter is a xml parameter in the customAction.xml file that points to the validator class

ps the com.ptc.core.ui.validation.DefaultSimpleValidationFilter is extendable class that can be used. 

 

so your requirement is doable with validator/filter. 

 

PetrH. 

Translate
V_THAKARE6-ContributorAuthor
6-Contributor
Mar 13, 2024 12:59 PM UTC

PetrH,

Let me try extendable class (DefaultSimpleValidationFilter).

 

Thank you for your support.

Translate
V_THAKARE6-ContributorAuthor
6-Contributor
Mar 21, 2024 6:49 AM UTC

Hi PetrH,

 

Can I use API isHasResultingChange(): boolean for WTPart to check state of object?

 

Do you have any sample code for this, so that I can get some idea.

Translate