Skip to main content
7-Bedrock
February 20, 2020
Solved

How to customize to reset value on revising only (not on iteration)?

  • February 20, 2020
  • 2 replies
  • 2419 views

There is a attribute defined on a document type, the value is carried over by new iteration or revision once it was created out of box. How can I custom to not carry over the value but reset to empty every time new revision? Eg Audit Type field was set "Initial" at A.1, new iteration to A.2 the value carried over. However  when Revise to B.1, the value was reset to empty.

Best answer by BjoernRueegg

You need to write a NEW_VERSION Listener

See following example

// Get the event (NEW_VERSION)
VersionControlServiceEvent pmEvent = (VersionControlServiceEvent) event;
Workable target = (Workable) pmEvent.getEventTarget();

if (!WorkInProgressHelper.isCheckedOut(target)) {
// Here reset your attribute
}

 

2 replies

17-Peridot
February 20, 2020

You need to write a NEW_VERSION Listener

See following example

// Get the event (NEW_VERSION)
VersionControlServiceEvent pmEvent = (VersionControlServiceEvent) event;
Workable target = (Workable) pmEvent.getEventTarget();

if (!WorkInProgressHelper.isCheckedOut(target)) {
// Here reset your attribute
}

 

1-Visitor
February 20, 2020

This behavior has been introduced in 11.2 for the save-as, not sure about the revise.

Reset attribute values during "save as" & revise

 

@JenniferPierron: any comment on this?

 

 

14-Alexandrite
February 21, 2020

Hello Florent.

 

In Windchill 11.2, the Save As UI has been enhanced to allow editing of attributes.

The end user can set, modify and unset values of attributes in the UI where allowed.

Modifying Attributes during Save As Action

 

Revise has not been changed as of yet.

 

Cordially,

Jennifer Pierron

19-Tanzanite
February 24, 2020

This is really going to be useful.  I'm setting up views to contain this now and will let my users know.