Hello,
I have a screen as shown in the image. I want to make the SG Entity field required, which is a relationship. Is it possible?
Thanks, Nury
Hello,
I have a screen as shown in the image. I want to make the SG Entity field required, which is a relationship. Is it possible?
Thanks, Nury
Hey Nury,
unfortunately this is not possible without using CDMs.
But with the new CDM-Editor in 2023.06-ext3 it is pretty easy to build a CDM. In there just use a Validation Rule along this explanation (How to Determine, Whether a Link Is Established).
Cheers Felix
Hello @felix-blazing-river,
I use CDM and I want the “required relationship” also be shown on the UI.
In my example, Group is a relationship. Is this possible to add the * to the label and make the error message “Please choose group” display on top of the Group binding field?
Thanks a lot!
Hey @quynh-wintry-root,
you can add the * manually to role’s label in the relationship model - but then it would be shown on all bindings to that role. Currently it is not possible to edit the label of an individual binding. There is a ticket for this, let me know, if your project wants to be the trigger.
It is currently also not possible to show the validation message at the dropdown/any binding component. You could either model it to be shown just in the validation bar, or model it to a senseful field (eg Name) close by (I would recommend this. So if the user is on the Location screen and tries to save, they could easily jump back to the Company screen using the locator of the validation bar.)
Cheers Felix
Please note, that in 2023.06-ext3 a “This field is required” Validation Error is shown, if a CDM contains a to-1 Relationship Element with required fields, but no document was selected/link created. This is considered a bug (A12-15360), so please do not rely on this.
Is it possible to make a relationship required when creating or updating a document via an RPC/API request? I attempted to handle this with events, but the issue is that the document is created first, followed by the creation of the relationship.
Please have a look in Make relationship between models mandatory if there are some ideas, otherwise please ask again there ![]()