Entity Validation : Script Validation - Display customized message from bundle
Step1: Define Script expression for "LocationId"
Step2: Drag that View as Form on UI.
Run the page.
If your DepartmentId > 30, It should throw error when you click on any button.
Note: It won't execute your entity validation for "LocationId" until you change the value of that.
As shown below, i have deleted/altered the value of "LocationId", then only Entity validation will be invoked and throw an error message.
The Reason is:
If you see the ADF lifecycle - http://pavanadf.blogspot.in/2013/10/adf-working-flow.html
2nd step is "Apply Request Values" then 3rd step is "Process Validation" (Means: After applying the change only validation happens, if there is no change it will skip the validation step)