Apex - how to validate in common PlSql package and show custom messages
I'm new to APEX 4.2.
Currently if i let required field empty, then APEX puts systematic error message "XXX must have some value." near the field and into the page header.
I want to create custom business rule, that would show message for example "This action cannot be performed, because this and that...".
That kind of custom validation should be in my plSql package and somehow it should throw/send the phrase "This action cannot be performed, because this and that..." to the page header where was message "XXX must have some value.".
How can i create such custom error message to appear out using PlSql package function that i define myself?
I plan to create a common validation package, which has lots of plsql functions to validate lot of APEX pages/forms, all those functions should throw/send somehow arror messages to page header.
Can you give a hint how to do it?
I looked that this unofficial solution does not suit for me:
http://blog.theapexfreelancer.com/2011/02/writing-validations/
Because it disables APEX systematic automatic validations as i understand, and is unofficial.