Dear OF Team,
I have created a simple form with one code attribute (codes: 1, 2, 3) and added a custom error check: Condition to be verified: "$this < 4". Tested with comparison as well, it behaves the same.
As you can see in the attached screen shot, CM (1.6.6 [141]) displayes the error message without recording anything. After selecting any of the options, error messages disappear as expected. If I add idm:not-blank($this) in the Apply when field, only the default "This field is required" is displayed before editing. This looks like CM evaluates the error check while the attribute is empty, unless I'm missing something.
![alt text][1]
[1]: http://www.openforis.org/support/upfiles/Screenshot_20180702-093923_Collect_.jpg