Logic to throw bundled attribute level validations in OAF
The following logic has to be added in the EOImpl.java
/**Add Entity validation code in this method.
*/
protected void validateEntity() {
super.validateEntity();
ArrayList errMsg = new ArrayList();
Number orgIDNo = getOrgId();
if (orgIDNo == null) // throwing Attribute Level Validation if the endDate is NULL
{
OAAttrValException ex1= new OAAttrValException(OAAttrValException.TYP_VIEW_OBJECT,
"ItemLinesEOVO1",
getPrimaryKey(),
"OrgId",
getAttribute("OrgId"),
"FND",
"XXCUS_ICRE_ORGID_NULL");
errMsg.add(ex1);
}
//'XXCUS_ICRE_TEMPLATE_ID_NULL'
Number templateID = getTemplateId();
if (templateID == null) // throwing Attribute Level Validation if the endDate is NULL
{
OAAttrValException ex2= new OAAttrValException(OAAttrValException.TYP_VIEW_OBJECT,
"ItemLinesEOVO1",
getPrimaryKey(),
"TemplateName",
getTemplateId(),
"FND",
"XXCUS_ICRE_TEMPLATE_ID_NULL");
errMsg.add(ex2);
}
OAAttrValException.raiseBundledOAAttrValException(errMsg);
}
The following logic has to be added in the EOImpl.java
/**Add Entity validation code in this method.
*/
protected void validateEntity() {
super.validateEntity();
ArrayList errMsg = new ArrayList();
Number orgIDNo = getOrgId();
if (orgIDNo == null) // throwing Attribute Level Validation if the endDate is NULL
{
OAAttrValException ex1= new OAAttrValException(OAAttrValException.TYP_VIEW_OBJECT,
"ItemLinesEOVO1",
getPrimaryKey(),
"OrgId",
getAttribute("OrgId"),
"FND",
"XXCUS_ICRE_ORGID_NULL");
errMsg.add(ex1);
}
//'XXCUS_ICRE_TEMPLATE_ID_NULL'
Number templateID = getTemplateId();
if (templateID == null) // throwing Attribute Level Validation if the endDate is NULL
{
OAAttrValException ex2= new OAAttrValException(OAAttrValException.TYP_VIEW_OBJECT,
"ItemLinesEOVO1",
getPrimaryKey(),
"TemplateName",
getTemplateId(),
"FND",
"XXCUS_ICRE_TEMPLATE_ID_NULL");
errMsg.add(ex2);
}
OAAttrValException.raiseBundledOAAttrValException(errMsg);
}
No comments:
Post a Comment