Question
· Aug 27, 2019

How to get last inserted RowID when %Save() function is used?

I need RowId of inserted record.

I have used below logic to get max row id,

but it will  not give desired result when multiple people enter record in the table at the same time.

 

Discussion (7)1
Log in or sign up to continue

When you create a class that the IDs are maintained by the system (standard class without modifying the storage, then  there is a  save  mechanism to give a new ID to every new object that is being saved to the database.

Of course that when multiple users are saving new data simultaneously , a specific process ID after a %Save() might not be the last one in the table.