How to add validation on save document based on value fetched from database

Dear @tmatteson
Did you have any help on this topic i creaded about this issue