Custom condition is validated but error is not shown in FE

Hello,

we have implemented Custom Condition to validate duplicites of values in Fields in Documents.
We have defined rule in Document Model like this.

          {
            "type": "Rule",
            "id": "rule_7935a",
            "name": "FoerderungAlreadyExisting",
            "Rule": {
              "errorEntityId": "include_99c89_field_69112",
              "errorCode": "Error rule_7935a",
              "errorCondition": "FieldFilled(XFLB_root/Name) \nAnd CustomCondition FoerderungAlreadyExisting",
              "severity": "ERROR",
              "errorMessage": [
                {
                  "locale": "de",
                  "text": "Unter diesem Namen existiert bereits eine Förderung. Bitte anderen Namen wählen."
                }
              ]
            }
          },

While debugging the Java Code wit Custom Condition is executed and in Browser we see that error is trandferred to the FE.


What is not working is that error is not shown in form at required field.
Do you know, what do we miss?

Hi,
the issue here is that this error is returned from the backend.

It is not a typical (client-side) form validation error that the form engine would know about. I suspect that the form validation was either not triggered or it didn’t find this inconsistency. Maybe the custom condition implementation was not available or differs on client-side.

Please remember, that custom conditions implementations have to be done twice or at least made available to both client- and server-side validation.

It is possible to also display server-side validation errors in the form engine. You would have to turn those errors into the proper form engine-specific types and set the validation message state of the form engine from your client-side application code.

However, I would guess that you rather want to look into why the client-side custom condition evaluation either did not take place or didn’t return what you would expect.