What if you have entity level validation rule and want to attach validation error message to specific field. By default this is not possible - all entity level validation error messages are displayed in the popup and are not attached to the fields (differently than attribute level validation rule messages).
Apparently there is a way to achieve such requirement with Groovy expression, this can be executed from entity level validation - adf.error.addAttribute('Salary'). In addAttribute you need to provide attribute name which will be assigned with the error. Complete expression for entity validator:
Result displayed on UI - validation error message is assigned to the field, which was changed:
Download sample application - GroovyADFApp_v2.zip.
Apparently there is a way to achieve such requirement with Groovy expression, this can be executed from entity level validation - adf.error.addAttribute('Salary'). In addAttribute you need to provide attribute name which will be assigned with the error. Complete expression for entity validator:
Result displayed on UI - validation error message is assigned to the field, which was changed:
Download sample application - GroovyADFApp_v2.zip.
Good Example.
ReplyDeletePlease correct the message.. It should be 2000 instead of 1000. :)
This is mistype, doesnt matter - will keep it. Thanks for pointing out.
ReplyDeleteAndrejus
Hi Andrejus,
ReplyDeleteAs you are doing also JET articles, how can you handle this type of validation message in JET? (I'm just curious)
Sébastien
Hi,
ReplyDeleteI have a post for this: http://andrejusb.blogspot.lt/2016/01/handling-adf-bc-1221-rest-validation-in.html
Andrejus