Search This Blog

Thursday, 4 April 2013

Entity Level Validation for StartDate and End Date comparison


Entity Level Validation for StartDate and End Date comparison

Entity Level Validation for StartDate and End Date comparison


In EOImpl.java


  protected void validateEntity()
  {
    super.validateEntity();
    Date sdate=getStartdate();
    Date Edate=getEnddate();
    if(sdate.dateValue().getTime()>Edate.dateValue().getTime())
    {
      throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
      getEntityDef().getFullName(), // EO name
      getPrimaryKey(), // EO PK
      "Enddate", // Attribute Name
      Edate, // Attribute Value
      "AK", // Message product short name
      "FWK_TBX_T_END_DATE_PAST"); // Message name

    }
  }

No comments:

Post a Comment