cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

API to get the template a Change Notice was created from

aacciano3
13-Aquamarine

API to get the template a Change Notice was created from

Hello,

 

Does anybody know the API to get the Template a Change Notice was crated from?

 

aacciano3_0-1602690109963.png

 

2 REPLIES 2

Hi,

 

It looks like you can simply use 

wt.change2.WTChangeOrder2 ecn;
wt.enterprise.TemplateInfo temp = ecn.getTemplate();

 

use this method in your validator 

public static WTReference getChangeTemplatePickerReference(FormDataHolder paramFormDataHolder)
throws WTException
{
logger.debug("getChangeTemplatePickerReference starts");
if (paramFormDataHolder == null) {
return null;
}
Map localMap = paramFormDataHolder.getComboBox();
if (localMap != null)
{
List localList = (List)localMap.get("ChangeObjectTemplatePicker");
logger.debug("localList:"+localList);
if (localList != null)
{
String str = (String)localList.get(0);
NmOid localNmOid = NmOid.newNmOid(str);
logger.debug("localNmOid:"+localNmOid);
return localNmOid != null ? localNmOid.getWtRef() : null;
}
}
logger.debug("getChangeTemplatePickerReference ends");
return null;
}

 

WTReference changeTemplateReference = getChangeTemplatePickerReference(validationCriteria);
WTChangeOrder2 ecn = (WTChangeOrder2)changeTemplateReference.getObject();
logger.debug("Change Template Name "+ecn.getName());

above line will give you the ECN Template name, carefully type cast, code is just for reference

Announcements