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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Hide/Remove customized action from Project Link for WTPart object

Vaibhav_Thakare
10-Marble

Hide/Remove customized action from Project Link for WTPart object

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

ACCEPTED SOLUTION

Accepted Solutions

Hi @Vaibhav_Thakare 

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

 

View solution in original post

20 REPLIES 20

Hi @Vaibhav_Thakare 

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.

 

 

URL_Error.png

Hi @Vaibhav_Thakare 

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

 

Customized action button in Global Search.png

Hi @Vaibhav_Thakare 

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

Hello PetrH,
 
First of all Thank you very much for your all time support.
 
As you suggested i did code changes now the action "eMail Multi-Level BOM Report" is now invisible in search table, see below attached screenshot.

 

Customized action button in Global Search_Hidden Action.png

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.

 

Customized action button in Global Search_Visible Action.png

 

Can you please suggest how i can remove action from there. 

Hi @Vaibhav_Thakare 

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.

Hi @Vaibhav_Thakare 

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?

Hi @Vaibhav_Thakare 

Yes, All the discussion is about the validator. and java code. 

PetrH

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;
	}

 

TDT
14-Alexandrite
14-Alexandrite
(To:Vaibhav_Thakare)

Hi @Vaibhav_Thakare,

 

The link is able to access.

HelesicPetr
22-Sapphire I
(To:TDT)

@TDT 

Thanks for confirmation that the link works.

. I was getting a message for a while 😄

HelesicPetr_0-1707132842877.png

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.

 

TDT
14-Alexandrite
14-Alexandrite
(To:Vaibhav_Thakare)

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.  

Hi @Vaibhav_Thakare 

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

Announcements

Top Tags