Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I just wanted to display the promoted-on date for CN which is in Resolved state in QML. But at the same time, I am displaying change notice which is in other states also in the report. For those, which is in other state, I don't want to display the promoted-on date. Can anyone help?
Solved! Go to Solution.
I understand that you want to build a Query Builder report, which will display the WTChangeOrder2 ResolutionDate -- but only when the lifecycle state of the WTChangeOrder2 is RESOLVED. One way is to follow the procedure for adding a Java method for use in QueryBuilder -
1) Documentation at https://support.ptc.com/help/wnc/r12.1.1.0/en/?#page/Windchill_Help_Center/customization/WCCG_BUSLogicCust_ReportGeneration_JavaMethods.html
2) Example file which takes a CN, and displays Resolution Date if lifecycle state is RESOLVED -- otherwise it displays nothing -- at bottom - create java file and compile
3) Add this line to Windchill/conf/queryBuilderMethods.xml
<method class="ext.tsd.QueryBuilderHelper" name="getResolutionDateIfStateResolved" static="true"/>
4) Load application data (instructions in documentation above)
5) Select in Query Builder by passing CN
package ext.tsd;
import java.sql.Timestamp;
import wt.change2.WTChangeOrder2;
import wt.lifecycle.State;
public class QueryBuilderHelper {
public static Timestamp getResolutionDateIfStateResolved(WTChangeOrder2 wtChangeOrder2) {
if(wtChangeOrder2 != null && wtChangeOrder2.getLifeCycleState().equals(State.toState("RESOLVED"))) {
return wtChangeOrder2.getResolutionDate();
}
return null;
}
}
Take a look at this discussion, hope could help you
Hi, thanks for your kind response. It didn't work as the promotion request will not involve in change notice state change process, I think. Here the state change is happening either by doing set state or following the approval process.
Then take a look at this
https://community.ptc.com/t5/Windchill/Change-object-Date-Completed/td-p/32013
I understand that you want to build a Query Builder report, which will display the WTChangeOrder2 ResolutionDate -- but only when the lifecycle state of the WTChangeOrder2 is RESOLVED. One way is to follow the procedure for adding a Java method for use in QueryBuilder -
1) Documentation at https://support.ptc.com/help/wnc/r12.1.1.0/en/?#page/Windchill_Help_Center/customization/WCCG_BUSLogicCust_ReportGeneration_JavaMethods.html
2) Example file which takes a CN, and displays Resolution Date if lifecycle state is RESOLVED -- otherwise it displays nothing -- at bottom - create java file and compile
3) Add this line to Windchill/conf/queryBuilderMethods.xml
<method class="ext.tsd.QueryBuilderHelper" name="getResolutionDateIfStateResolved" static="true"/>
4) Load application data (instructions in documentation above)
5) Select in Query Builder by passing CN
package ext.tsd;
import java.sql.Timestamp;
import wt.change2.WTChangeOrder2;
import wt.lifecycle.State;
public class QueryBuilderHelper {
public static Timestamp getResolutionDateIfStateResolved(WTChangeOrder2 wtChangeOrder2) {
if(wtChangeOrder2 != null && wtChangeOrder2.getLifeCycleState().equals(State.toState("RESOLVED"))) {
return wtChangeOrder2.getResolutionDate();
}
return null;
}
}
Thank you! it helps🙂
I hope this will help. if you have want to be more clear I have put my question here in this Youtube groups.