Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
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
Solved! Go to Solution.
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.
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.
But I want to add some other users/groups apart from Change Admin II or an org/site admin.
What is your opinion.
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.
PetrH,
Let me try extendable class (DefaultSimpleValidationFilter).
Thank you for your support.
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.
Hi @V_THAKARE
Here is a helper with an example input to get what you need.
if you use true, the Activity is return if you use false, the link Record is returned.
QueryResult var7 = ChangeHelper2.service.getLatestChangeItem(wtpx, "theChangeActivity2", wt.change2.ChangeActivity2.class, wt.change2.ChangeRecord2.class, true);
PetrH