Adapt error condition in the back-end

We have to adapt some properties of a model we get. For some fields, for instance, we need to change their field type to Strings, like so:

I now have to adapt error conditions on a rule, of which the error condition currently is “FieldFilled(fieldPath)”, but should become:

“FieldFilled(fieldPath) AND Invalid(” + fieldPath + ", "Steuernummer" )

How do I finish this code?

Hi @jasper-silent-root,
what you have done with the field type is not recommended since you are using (a12)internals: FieldWrapper, Field, FieldType, etc. What you want to do with the rules is also not recommended because of the same reason. At the moment, there is no public API for changing IDocumentModel (except for the annotations), if you really need this, you would have to create a requirement.

Hello @jasper-silent-root , I am a member of the Discourse team. I can see that there was a new response to your question on the Topic of the discussion. Do you find it helpful, or should the question remain open? Did you created a Ticket for this topic?

Thanks ahead for your feedback and have a nice rest of the day!