Good Afternoon,
When using Forms Designer we have a lot of areas where we wish to capture data from one form and set into SessionStore to pass through to another form, either opened in dialogue or redirected. I am trying to recreate this ability within Plumsail Forms and can’t see how to get the Current Item Id to store in the session store: -
An example of the code used in Forms Designer is below
sessionStorage.clear();
var companyNameId = GetUrlKeyValue(‘ID’);
sessionStorage.setItem(‘companyNameId’, companyNameId);
var companyName = fd.field(‘Title’).value();
sessionStorage.setItem(‘companyName’, companyName); openDialogBox(_spPageContextInfo.webAbsoluteUrl +’/Lists/Contacts/fd_Item_NewForm.aspx?’);
I have tried to recreate this in Plumsail Forms but cannot, my code is below
sessionStorage.clear();
var companyNameId = window.top.fd.itemId;
sessionStorage.setItem(‘companyNameId’, companyNameId);
openDialogBox(_spPageContextInfo.webAbsoluteUrl
+’/SitePages/PlumsailForms/Contacts/Item/NewForm.aspx?’);
This doesn’t work, if I replace “window.top.fd.itemId” with say “870” a valid Item Id this works fine…
Secondly the rest of the code that goes with this is the openDialogBox function, on forms designer this code opens the New Item Form in a dialogue, and on save it then uses the call back to refresh the page. Again this does not seem to work. Help appreciated.
function openDialogBox(Url) {
var ModalDialogOptions = {
url:Url,
width:1000,
height:800,
showClose: true,
allowMaximize: true,
dialogReturnValueCallback: function(dialogResult) {
if (dialogResult != SP.UI.DialogResult.cancel) {
SP.UI.ModalDialog.RefreshPage(dialogResult)
}
}
};
SP.SOD.execute(‘sp.ui.dialog.js’, ‘SP.UI.ModalDialog.showModalDialog’, ModalDialogOptions);
};
Thanks