Validate Custom Field =- Code example?

Thanks - I’ve read your thread but am not much wiser, I’ve tried to enter your code bt amend it to fit my needs but I just get errors that don’t explain what the issue is.

On your advice above, to do a Method DirectiveBPM, would this be pre or post processing?