Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hello PTC Community team/members,
I have created one customized action for WTPart but whenever I share any WT Part to Project Link that same action also visible into Project Link. Can anyone know how I can hide/remove that customized action for the team/role. Attached picture for the reference(yellow highlighted action, I want to hide).
Solved! Go to Solution.
It is a link to the Windchill help center 13.0.1.0
My access has been also denied to 13.0.1.0 so try 13.0.0.0
Implementing Validation Filters
or go to help https://www.ptc.com/en/support/help/Windchill and search for the Validation filter
PetrH
You can simply use a Validator filter.
You just need to write a code that allows the action in the menu. It is up to you what you want to check.
Implementing Validation Filters
By code you can check groups roles or any other conditions
PetrH
Hi PetrH,
Unable to access the link you shared. Getting below error.
It is a link to the Windchill help center 13.0.1.0
My access has been also denied to 13.0.1.0 so try 13.0.0.0
Implementing Validation Filters
or go to help https://www.ptc.com/en/support/help/Windchill and search for the Validation filter
PetrH
Thank you PetrH,
Now able to access the link.
Let me try to hide customized action using Implementing Validation Filters, and will let you know the final result.
Thank you once again for your quick response.
Hello PetrH,
Using Implementing Validation Filters, Now my customized action is not visible in Project container.
But again one issue arise.
If I search same shared part as a external partner using global search, in this case the customized action is again coming(See attached screenshot for the reference).
You need to define a condition that the function is run from search table
So if you find that the validator is run from the search table, just hide the function
WTReference contextObject = criteria.getContextObject();
String compContext = criteria.getCompContext();
if (contextObject != null)
{
if (!compContext.contains("searchResultsTableComp"))
{
validatioNStatus = UIValidationStatus.HIDDEN;
}
}
PetrH
But if I click on part/product number then inside it there is action button where "eMail MultiLevel BOM Report" action is still visible. See below attached screen shot.
Can you please suggest how i can remove action from there.
Where do you need to show the action? What table do you need it ?
You should just need to change the condition to show the action only in the place where you need.
PetrH
Steps to reproduce issue
1)Create user and consider it as a external user.
2)Give him Project Container access only.
3)Create custom action for WTPART object in action button.
4)Using Validator hide the same custom action for Project container and searchResultsTableComp as well.
5)Share Part-assembly to Project container.
6)Login windchill as a external partner(having only project container access).
7)Search the Part Assembly (shared from product container) using global search and in search table you will be able to see Part assembly.
8)In same search table window, Click on Part info icon.
9)After entering into Assembly structure click on action button and there you can see the customized action which I want to hide.
Note : External Partner is not having Product and Library container access so whenever is searches for the Part using global search, the custom action should not be visible to him.
Create a condition that checks if the user is not in the product team and hide the action.
PetrH
Ok, Let us try this one.
We need to put that condition in Validator.java file, right?
You can hide for Project Link by checking the invoked from container:
@Override
public UIValidationStatus preValidateAction(UIValidationKey key, UIValidationCriteria criteria) {
// visible by default
UIValidationStatus status = UIValidationStatus.ENABLED;
WTContainerRef cr = criteria.getInvokedFromContainer();
if (cr == null) {
return status;
} else if (cr.getReferencedContainer() instanceof Project2) {
status = UIValidationStatus.HIDDEN;
}
log.info("preValidateAction(): Leaving status = " + status);
return status;
}
Thanks for confirmation that the link works.
. I was getting a message for a while 😄
Now it works ok.
PetrH
Hi PetrH,
One more suggestion I need from you.
<objecttype class="wt.part.WTPart" name="CustActionreport" >
<action name="CustAction" renderType="GENERAL" resourceBundle="ext.com.custact.Custreport">
<command url="/wtcore/jsp/com/custact/custreport.jsp" windowType="popup"/>
<excludeFilter name="hideForObjectInProject" />
</action>
</objecttype>
Code copied from PTC site, Does it will work or I need to create class file to hide this customized action.
Hi @Vaibhav_Thakare,
Have you created a custom class and registered in Xconf with selector value ="hideForObjectInProject" ?
I am going to create a custom class.
If the hideForObjectInProject is OOTB filter, yes it could work. You need to try it.
If it does not work, you need to create own class.
PetrH
Yes