Hi guys,
I am using A12 in the 2023.06-ext1 version.
I have two documents Item and Manufacturer, they are related to each other by a Relationship model.
The Item form has a binding with a DropDownSelection component, which contains all Manufacturers and the Manufacturer can be assigned to an Item during its creation, but the selection is optional. I want it to not be optional, but required that a Manufacturer is selected.
I found in the documentation GetA12 Login, at the Validation & Computation part, that they are not supported by Relationship models.
Just to make sure I’m not missing anything, is there a build-in way to define a relationship as mandatory? And if that is not the case, what would be the approach to this problem?
I first thought about an event listener, but haven’t found one which would be suited. The DocumentBefore… events are all just get the document, which does not contain any information about relationships and for relationships there are only …afterCreate/Update/Delete events.
The only other possible solution I can think of would be to listen for DocumentAfterCreate events, then querying the DB for relationship links, then checking if there are new links created for the desired documents and if that is not the case, deleting the document again.
Maybe someone already stumbled upon this kind of problem, as I think it’s a common problem case?










