Checking for duplicates of an entity AFTER adding said entity

We currently have row owners in place so one customer cannot accidentally see another customers vehicles and for added security.

The issue is we do not want two separate customers to have the same license number as this causes errors in the system when they go to fill-up.

How can I do a check for duplicate license numbers at fill-up (currently a customer drives in, the attendant enters the license number, and it does a relation to a vehicle in our data. I want it to block if theres a dupe). On top of that, admins are able to see all vehicles via a second row owner. How can I do a query that will show them the duplicates?

The obvious ideal scenario would be blocking it once a customer adds a vehicle, however I’m assuming due to row owners that would not be possible hence the above.

Maybe this will help:

1 Like

Same problem mentioned in the thread above.

Give the attendants a common role, and make that role an owner in the vehicles table.