1) sounds like you can't validate for an empty field then. How do you distinguish between an address that requires a post code and one that does not?
2) A validation error should appear each time a record with the error is committed--whether or not it is a newly created record, but you might investigate using the OnObjectValidate trigger to check for an empty field and use the script to display your own custom dialog. A message in a custom dialog can be a much less confusing message than the standard custom validation message from field options.
1/ - Uk Addresses (based on my Country field) will require a Post Code. What I want it a message to appear maybe when the record is committed that, on a uk country based record, a message appears pointing out the requirement of a post code to the user.
2/ I assume this would only work if the user enters the field and tabs to the next one, leaving the post code field empty? If so, would i validate by calculation as I have tried a few things bit nothing really worked how I expected - If you could expand a little on how the onobjectvalidate trigger works then that would be great...
I thought about trying to find error code for validation of field that is triggered when the layout is exited- would this be possible?
1) then a validation by calculation can be defined:
IsEmpty ( self ) and Country = "UK" //use the correct field name for country and the correct value for United Kingdom as found in your database here
2) Yes, that is correct. But this runs a script so you can do all the things a script might do such as using an If step to check the value in fields (such as the expression in 1, but with a field name in place of "self") and then using show custom dialog to display the appropriate message and with just the buttons you want to use for managing the error. You'd use Exit Script [False] to return the user back to the appropriate field to correct the error and thus keep any built in validations such as 1) above from kicking in yet.
Note, script trigger validation is specific to the layout where you set it up. Field Validation is one setting that applies throughout your database. Thus, it is often a good idea to use both. Use the script trigger to keep things more user friendly, but have the field option validation in place as "insurance" against an error getting in if the user finds a "loop hole" around your interface design or you miss that detail somewhere on another layout...
Seems to make sense. Will try it out. Thank you