Hello,
I'm trying to use the code below to update a newly created child item using the list or library dialog. However, it seems the dialog is closing before the update can be completed.
Thanks for your help.
fd.spSaved(function (result) {
// This code is executed after saving the form
var redirect = result.RedirectUrl;
result.RedirectUrl = null;
//Get the saved item ID
var itemId = result.Id;
sessionStorage.setItem('itemId ', itemId );
console.log('New Item Id', itemId);
//Compose a unique reference
var poval = 5000 + itemId;
console.log(poval);
var siteURL = 'https://test.sharepoint.com/sites/test;
var web = new Web(siteURL);
var i = web.lists.getByTitle('Parts').items.getById(itemId).update({
PO: poval
}).then(function(){
console.log("Updated!");
window.location.href = redirect;
});
});