If you are using FileMaker 11 or newer, there is indeed a script trigger: OnObjectValidation that can be set on the customer field.
If you are using Filemaker 10, you can try using OnObjectSave or OnObjectExit and you may be able to get that to work.
Doesn't the OnObjectValidate trigger work BEFORE the data entered into the field is validated?
Below is the script that I wanted to run after OnObjectValidate, and I'm stumped on how to set it up properly to work.
Set Error Capture [ On ]
If [ Get ( LastError ) = 506 ]
Go to Layout [ “Customers” (Logistcs) ]
Yes it runs before validation so you then do your own validation test. Here's code for confirming that value is member of a value list:
If [ IsEmpty ( FilterValues ( ValueListItems ( Get ( FileName ) ; "YourValueListNameInQuotesHere" ) ; YourTable::YourFIeld ) ) ]
Show Custom Value ["Value must be member of value list."]
Exit Script [False]
Hey Phil, I had this same problem and just ran across this answer of yours. It took me awhile, but I got it working. Just what I needed. Thanks again for your brain.