Hi guys,
I have a table which allows multiple Items, but only one record can be primary.
I created an index which consist in Item and PrimaryItem field. However, the PrimaryItem field is a checkbox, and even when the value is No
it will trigger preventing the user to create a new record. Only one Primary Item field can exist.
How can I accomplish this? Is it validatedWrite() the only way?
Example:
Table
ItemId | Info1 | Info2 | PrimaryItem (Checkbox No::Yes)
Item1 | info | info | Yes
Item 1 | info | info | No
Item 1 | info | info | No