I handle this from a workflow expression robot. You should run this as
soon as the ECN is created. Mine is a bit different where I am changing
the ECR number to match the ECN number but you should be able to reverse
this. Actually, I wrote this to manually change the numbers of existing
change objects.
wt.change2.WTChangeOrder2Identity ecnID =
wt.change2.WTChangeOrder2Identity.newWTChangeOrder2Identity((wt.change2.
WTChangeOrder2)primaryBusinessObject);
for( wt.fc.QueryResult queryresult =
wt.change2.ChangeHelper2.service.getChangeRequest((wt.change2.WTChangeOr
der2)primaryBusinessObject, true); queryresult.hasMoreElements();)
{
wt.change2.WTChangeRequest2 ecr =
(wt.change2.WTChangeRequest2)queryresult.nextElement();
wt.change2.WTChangeRequest2Identity ecrID =
wt.change2.WTChangeRequest2Identity.newWTChangeRequest2Identity(ecr);
System.out.println("ECN:"+ecnID.getNumber());
System.out.println("ECR:"+ecrID.getNumber());
ecnID.setNumber(newNumber);
ecrID.setNumber(newNumber);
wt.fc.IdentityHelper.service.changeIdentity(ecr,ecrID);
wt.fc.IdentityHelper.service.changeIdentity((wt.change2.WTChangeOrder2)p
rimaryBusinessObject,ecnID);
}
Make sure that you set the preference for a 1 to 1 relationship between
ECRs and ECNs. It's possible to have a number uniqueness conflict but
it would be rare. What your customer will find confusing as a result is
that when they search on an ECN number by number, they will return two
objects now. Unless they are trained, it is easy to confuse the ECR
from the ECN on the search results. They look similar and the only
difference is the icon.