How to get newly created row id
How to get newly created row id
f.talamini@stmingegneria.eu
Posts: 23Questions: 11Answers: 0
in Editor
Hello, I need to have the id of a newly created row within a submitSuccess event routine.
It seems the json parameter does not help since the id is setted to null.
How can i do?
Thank you,
Regards,
Franco
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi f.talamini@stmingegneria.eu the way I achieve this is to ensure that the id is included in my http response from the server. Assuming that your Id is an Identity field, this may require you to retrieve the the record from your database after the record is created and include it in your response.
You should be able to access the id with the json parameter on the postSubmit event once it is included in your response message.
Is what I'm thinkin :-)
Shay
Hi Franco,
In addition to what Shay says, can you show the JSON the server is responding with please? The ID should not be null (assuming it is an auto increment column in the database).
Allan
Thank you all.
I've found the point:
I was doing wrong with the idSrc property in the editor. It must be pointed to the key field with the AI property setted.
Franco