I have a rigged a link to call the NewItem.aspx form in a dialog. When the User clicks 'Save', I would like to return the new item ID in the callback function. How is this achievable?
<a href='javascript:openDialog()'>New Item</a>
function openDialog(test) {
var options = {
title : "New Item",
url : "/_layouts/BRP_CustomWelcome/DialogLocation.aspx",
dialogReturnValueCallback : dialogCallback,
};
SP.UI.ModalDialog.showModalDialog(options);
}
function dialogCallback(dialogResult, returnValue) {
if (dialogResult == SP.UI.DialogResult.OK)
{
var id = returnValue; //HOW DO I GET THE NEW ID HERE?!
customJSFunction(id);
}
}