how to make ID (auto increment) appear before save / commit

how to make ID (auto increment) appear before save / commit?

Explain better what do you want to achieve, id is already auto incremented by your db when commit occurs.

Hi Clauu,

You right what id is auto incremented BY DB when commit occurs. But I want it to appear on the form before commit (add button).

Then you’ll have to add a new field visible ony in insert mode and in a event like onload set that field with the latest id from db or use the grid lookup

If you are using an auto increment field you simply cannot. If you use a simple integer you can do a select max(myid) from mytable to get the highest available key and add 1 to it. You can do this in the onload event.

I strongly recommend not using this technique if more than one user can access your application. Suppose two people want to add a record. As long as the new number is not inserted both will get the same key. ONe can save, the other will get a duplicate key error.

Makes sense. Thanks Albert.