Hi Tommy,
Thanks for the reply, and apologies for not replying earlier. I found the bug in the code, but the custom validator still doesn't work. To try to narrow it down, I created a brand new XPage with just two fields, the Keyword Name and Keyword Value, plus an error control for each and a Save (Submit) button. Just to refresh, I want to block the ability to create two keywords with the same name.
On the Keyword Name, I made it a mandatory field. I also added the custom validator, plus put a mandatory validator on the keyword value. If I leave a field blank, I get the popup error message that I put in the mandatory message. But, it seems like the custom validator runs AFTER the document has been saved, as checking a view in the background the document is there. The message is displayed in the browser, but the fields have been cleared. It does appear that the code works, it's just not running when it should - before the document is saved. Is there something I'm missing?
Again, thanks for any help.
Regards,
Cameron.