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 137
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