Custom validation for Form Engine

Hey there.

Is it possible to create a custom frontend validation for relationship bindings in CDD form model? We want dropdown selector to be marked with a red frame when it’s empty.

Our case: we have Person-CDM and Person-CDM-FM (form model). In the form model there is a binding for one-to-one relationship to another Person. Currently no validation feedback for user is being displayed.

Hey all,
please also have thread Make relationship between models mandatory in mind.
It might be a slightly different question here, but a solution could also help the other thread.

@k.szwej, please keep in mind, that your question will only be a front-end solution, no server-side checks will be done.

The problem is the check is already done in the backend, but we want to add the additional in the frontend, which will prevent submitting the form without filled field. Also, there is no feedback in the frontend which would help to identify missing field, we would like to have red frame around the missing field.

Hi.
Unfortunately, it is currently not possible to achieve this with the cdm drop down selection.
The drop down selection component would need to be customized, maybe to show the error of some technical, hidden error field used in the rule. The rule would have to ensure the existence of the group instance of the other person.

However, at the moment we do not support customization of the cdm ui components. We also currently don’t have built-in support for displaying an error on the cdm drop down, as it is not bound to a field and merely there to create a group instance within the cdm based document.

A workaround would be to model in the cfm a (readonly) control based on some identifying field of the other person, e.g. the name, close by the binding. In the cdm a rule would be added to make this field mandatory, with some hint in the error message that the other person needs to be selected (or created) via the dropdown.
If the user would try to save without selecting another person, the validation error would appear above the new control input.

If this workaround is not an option, please create a new requirement ticket.