Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hello,
Does anybody know the API to get the Template a Change Notice was crated from?
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