New topic Closed topic
avatar image
1
Record Uniqueness by combining properties / relations?
By Created , last editted

Hey,


I am looking for a way to validate a record by uniqueness by looking at the combination of 2 properties or a property and a relation.


Lets say there is a model "project" and a model "project day". Before a new record of "project day" is created or a record is being updated, the combination of "project" and the "project_day.date" should be unique; per project, there can only be one project day with the same date.


Also, when a property on the record is updated, which is not the "project" and/or the "date" property/relation, the validation should still work. (I forgot to state this in the original post, but is quite important...)


Hey,


I am looking for a way to validate a record by uniqueness by looking at the combination of 2 properties or a property and a relation.


Lets say there is a model "project" and a model "project day". Before a new record of "project day" is created or a record is being updated, the combination of "project" and the "project_day.date" should be unique; per project, there can only be one project day with the same date.


Also, when a property on the record is updated, which is not the "project" and/or the "date" property/relation, the validation should still work. (I forgot to state this in the original post, but is quite important...)

Answers
Sort by:

This topic is closed.