AI-674 - added validation for codes (valid from expression point of view and unique within the form class). Code is updated in model only if it's valid.