Skip to main content
14-Alexandrite
August 12, 2024
Question

Customizing save-as using CopyWTPartDelegate

  • August 12, 2024
  • 1 reply
  • 1091 views

Version: Windchill 12.0

 

Use Case: Need to add logic to set the subtype of the wtpart based on an attribute value selected by the user on the save-as page.


Description:

Is it possible to get the attribute values selected by the user on the save-as page in the CopyWTPartDelegate? I have successfully extended the default CopyWTPartDelegate with some custom code, but I can't figure out how to get a string value that the user enters/selects on the save-as page for an attribute and use that value in my CustomCopyWTPartDelegate.

Article https://www.ptc.com/en/support/article/CS28799 states that custom attributes can be set on the save-as page since 12.0, and I have confirmed it. I have also seen that a listener approach may not work for this purpose: https://www.ptc.com/en/support/article/CS408331. I haven't tried it yet.

1 reply

14-Alexandrite
August 21, 2024

Anyone?  @HelesicPetr 

 

I've tried many things but still can't get the attribute values set on the save-as page. DefaultAttributeContainerHelper.getUnclonedAttributeValues from https://www.ptc.com/en/support/article/CS28799 doesn't return them. PTC TS said they can't help me.

HelesicPetr
22-Sapphire II
22-Sapphire II
August 22, 2024

Hi @dmcalister-2 

Iam not sure if you can get this information in this Delegate.

You need the request and command bean where this information is stored from the browser generaly.

 

I checked the default save as delegate and I can just say that this delegate just create a new instance of a source wtpart and nothing else.

The new parameters are pickup from specific isntruction in different class so if you don't find a way how to get the instructions in this delegate your request would be really hard to achieve.. For example create own save as function.

 

here is the place where you can find all information from the wizard with new values

it is saveAsInstructions variable that is in a com.ptc.windchill.uwgm.proesrv.action.AbstractSaveAsAction class.

HelesicPetr_0-1724313896693.png

You can try to create SaveAs helper and try to get instructions from this helper. But Iam not sure if this is possible to do from delegate class.

 

PetrH