Saturday, August 15, 2015

ADF How to validate an old record only ... Record status


ADF  How to validate an old Record Only ... 

if you need to validate an old record only , In Oracle Entity object  - business rule you can validate new record only .

in this example we will check that user  can  set old salary value greater than 1000$ only

1- in EO Business rule set validation on Salary to compare Salary greeter than 1000$ .





2- in Validation Execution set Execution Condition :

import oracle.jbo.server.EntityImpl
adf.object.entityState != EntityImpl.STATUS_NEW



3- in Failure Handling set Error  Message  
Check Salary should greater than 1000$




Notes: in Groovy Expression you can check record Status 
we have Record Status 
STATUS_INITIALIZED
STATUS_NEW
STATUS_MODIFIED
STATUS_UNMODIFIED

you can check Status from EntityImpl Class

getEntityStatus() == STATUS_NEW



No comments:

O racle  SQL WITH Clause         subquery factoring     or         Materializing   subqueries                                 (Sim...