Skip to main content
14-Alexandrite
October 23, 2023
Solved

Can we make the Attachment section required?

  • October 23, 2023
  • 1 reply
  • 2850 views

Hello,

When creating a problem report, can we make the Attachment section required?

 

OnurNalbantgl_0-1698047173388.png

 

Best answer by Rocket_Max

Hi @OnurNalbantgl 

The article is for ECR, and I have made the necessary modifications according to your requirements. Please refer to the following steps

 

Step1:

Unzip the file, place it in your IDE environment (such as Eclipse),be sure to place the Java files in this directory <Windchill_Home>\src\formProcessor, and then compile it. Place the compiled file in this directory Windchill\codebase\formProcessor\SecondaryAttachment.class

Rocket__2-1698142732493.png

 

Rocket__4-1698142819100.png

 

If you do not have a IDE, you can also compile it with Windchill, run this commad in Windchill Shell, be sure to place the Java files in this directory <Windchill_Home>\src\formProcessor, a file with the same name will be generated, but the format is class, Place the compiled file in this directory Windchill\codebase\formProcessor\SecondaryAttachment.class

ant -f bin/tools.xml class -Dclass.includes=SecondaryAttachment.java -Dclass.source=%WT_HOME%\src\formProcessor

Rocket__5-1698143051399.png

 

Step2:

Find Windchill\codebase\config\actions\Custom-actions.xml and add below content

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE listofactions SYSTEM "actions.dtd">
<listofactions>
 <objecttype name="attachments" class="wt.content.ContentHolder" resourceBundle="com.ptc.windchill.enterprise.attachments.attachmentsResource">
 <action name="attachments_step" uicomponent="ATTACHMENTS" ajax="row" postloadJS="preAttachmentsStep" preloadWizardPage="false">
 <command class="formProcessor.SecondaryAttachment" windowType="wizard_step"/>
 <includeFilter name="hideFromDTI" />
 <includeFilter name="EDACompareFilter" />
 </action>
 </objecttype>
</listofactions>

Rocket__6-1698143225873.png

 

Step3:

Restart Windchill and test

Rocket__1-1698142096986.png

 

Good luck for you

 

1 reply

17-Peridot
October 23, 2023

Hello @OnurNalbantgl 

OOTB does not have such a function, you need to customize it. Please refer to https://www.ptc.com/en/support/article/CS306962

 

14-Alexandrite
October 23, 2023

great support.

But I don't know where to apply them.

Where do I apply the sample code?

to an xml in codebase? Or should I define it as an expression within the stream?

Your help will be unforgettable for me.

HelesicPetr
22-Sapphire II
22-Sapphire II
October 23, 2023

Hi @OnurNalbantgl 

Then you need to learn how to customize the Windchill. 

CS212271 - Windchill PLM - Customization

 

CS60345 - Windchill PLM - Customization Guides

 

PetrH