cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve last ID inserted

Former Member
0 Kudos

Hi,

I've a custom form within some EDIT fields and a Matrix binded to two user tables using a UDO.

I use it to handle Master-Detail data.

Adding a new record I would like to retrieve the last id inserted in Master table and then add the new record with ID = LastId + 1

How can I do this? May be I need to use an event which is raised just before the record is added to database and here execute my SQL statement which retrieve the last id fro Master table?

I hope it's clear.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

the company object has a property GetNewObjectCode that may help you to get the last generated code, but this value is right after an add.

you can also look in table ONNM, taht contain the list of ID for each objec.

Sebastien

Answers (1)

Answers (1)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Maybe you can find the solution in this message:

Regards

Trinidad.