CMDBuild Forum

validate entry in a master-detail relationship

I work with classes that are related by a domain like master-detail, in which I add several cards that could be repeated in the detail. Is there any way to validate that you enter only once in the detail, to avoid repeated cards?

Thanks and regards

I did not understand if your problem is to avoid repeating the reference to the master card when inserting the detail cards, or if your problem is not to have duplicate detail cards.

In the first case, using the TAB Detail present in each card to manage its detail rows your problem is already solved (obviously the domain must have the master-detail flag active).

In the second case you only have to define a unique attribute in the detail class.
CMDBuild Team

Previously Tecnoteca wrote:

I did not understand if your problem is to avoid repeating the reference to the master card when inserting the detail cards, or if your problem is not to have duplicate detail cards.

In the first case, using the TAB Detail present in each card to manage its detail rows your problem is already solved (obviously the domain must have the master-detail flag active).

In the second case you only have to define a unique attribute in the detail class.
CMDBuild Team

Thank you for your prompt response, it is about validating repeated records in detail, for example if the main card was an entry form to document the entry of new equipment to our offices, in this case, in the detail would specify all new equipment to register. These new equipment has been previously registered in the system so I relate them to the entry by means of a reference. By the method that you mention, if you validate me that there are not repeated details in the same entry. But it also does if I intend to use the same equipment in other subsequent entries. I do not know if I could explain myself better?

If you need to perform more complex validations right now you have to use a database trigger.
In version 3.0 (next year) there will be new mechanisms available directly on the form.
CMDBuild Team

Previously Tecnoteca wrote:

If you need to perform more complex validations right now you have to use a database trigger.
In version 3.0 (next year) there will be new mechanisms available directly on the form.
CMDBuild Team

Ok, thank you very much, I thank you ...

Regards