Dear all,
How can I limit the number of related records?
The use case:
- Entity "Location" has a field "Can hold multiple items"
- Entity "Item" has a lookup field "Location"
- When an item gets a Location assigned that already has an item assigned to it (in the case "Can hold multiple items" = False), it should be prevented somehow (indicating that the chosen location already has reached its limit)
How can I achieve this? I have tried a custom plugin, but it seems that this does not prevent anything; see code here : OneOrMultipleItemsPerLocation.cs (github.com)
A more general use case would be to have a numeric field "number of maximum items on this location" that would prevent to have more than this number assigned to this location....
Thanks,
Koen