I got a table, “Plan” with a few columns and a ID column that’s autogenerated when insert. When i’m working in the Insert server script, how can I know the ID?. I’m working on windows azure mobile service.
function insert(item, user, request) {
//I want to know the ID of the new item to be inserted.
}
The id is only generated when the item is inserted in the database, and it’s added as a new property to the
itemparameter. You can get to it by specifying a callback to the script in the insert operation: