Quite new here so I’ll try to explain my question.
I have a table with OrderID column.
When a new Order is added I set it’s initial value to MAX([OrderID])+1, which works as expected with no security filters.
Now say User 1 has added orders with OrderID’s 1 and 3 and User 2 has added an order with OrderID 2.
I also have a security filter on this table which gets only the orders of the currently logged in user.
When User 2 is using the app the above initial value evaluates to 3 when he adds an Order which should be three.
How can I resolve this?