We need to retrieve attribute information using standard lookup, but there are errors occurring during the retrieval process.
Code:
import oracle.apps.scm.doo.common.extensions.ValidationException;
TransactionTypeCode = header.getAttribute("TransactionTypeCode");
BuyingPartyNumber = header.getAttribute("BuyingPartyNumber");
def lines = header.getAttribute("Lines");
while( lines.hasNext() ) {
def line = lines.next();
def itemNumber = line.getAttribute("ProductNumber");
}
def rules = getStandardLookupDetails("XXXXX_PRETRANSFORMATION_RULES");
while (rules.hasNext()) {
def rules_row = rules.next();
throw new ValidationException("Unable to fetch Item Types from Lookup " + rules_row.getAttribute("AttributeChar1"));
}
Object getStandardLookupDetails(String lookupType) {
def lookupPVO = context.getViewObject("oracle.apps.fnd.applcore.lookups.model.publicView.LookupPVO");
def vc = lookupPVO.createViewCriteria();
def vcrow = vc.createViewCriteriaRow();
vcrow.setAttribute("LookupType", lookupType);
vc.add(vcrow);
def rowset = lookupPVO.findByViewCriteria(vc, -1);
if (!rowset.hasNext()) {
throw new ValidationException("Unable to fetch Item Types from Lookup " + lookupType);
}
return rowset;
}