Increment column with Max(column)+1 when using security filters

Gert1
New Member

Good day.
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?

Thanks

0 2 143
2 REPLIES 2

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Gert

I would suggest that you may save the last number used in an โ€œopenโ€ table, and use this one.
Just in case, here is a post you may want to read:

Thanks so much!

Top Labels in this Space