Cancel Button Redirect Source
Posted: 30 Jan 2019
Greetings,
I currently have a document set where I've put a button to the Edit Form of an item in a list. That part works great. However, when i get to the form, if I click "cancel", I get an error.
Error: "Sorry, something went wrong... an unexpected error has occurred"
Looking at the URL, it seems that the source is getting cut off.
To get back to the document set, I need the RootFolder to appear in the Source parameter. However, it doesn't show up. This is what I see:
https://<SPONLINE.com>/sites/DEVPIPCopy/PIPPRDPIPProjectDocuments/Forms/PIPDocSet/docsethomepage.aspx?ID=83
In my cancel button, I've put some code:
var theURLParam = fd.getUrlParam(window.location.href, 'Source');
var theRootFolder = fd.getUrlParam(window.location.href, 'RootFolder');
var theURI = theURLParam+'&RootFolder='+theRootFolder;
alert(theURI);
fd.sourceFormParam(theURI);
var theSourceForm = fd.sourceFormParam();
alert(theSourceForm);
via the alert(theSourceForm); I can confirm that the URI is correct. It contains the complete source needed, but it eventually returns to the error page.
I don't see anything of interest in the DEV console.
If I put the full URL for this particular docset into the "redirect after cancellation URL:", it works fine.
https://<SPONLINE.COM>/sites/DEVPIPCopy/PIPPRDPIPProjectDocuments/Forms/PIPDocSet/docsethomepage.aspx?ID=83&RootFolder=/sites/DEVPIPCopy/PIPPRDPIPProjectDocuments/PIP18
Hoping I just missed something silly.
Thanks!
Victor
I currently have a document set where I've put a button to the Edit Form of an item in a list. That part works great. However, when i get to the form, if I click "cancel", I get an error.
Error: "Sorry, something went wrong... an unexpected error has occurred"
Looking at the URL, it seems that the source is getting cut off.
To get back to the document set, I need the RootFolder to appear in the Source parameter. However, it doesn't show up. This is what I see:
https://<SPONLINE.com>/sites/DEVPIPCopy/PIPPRDPIPProjectDocuments/Forms/PIPDocSet/docsethomepage.aspx?ID=83
In my cancel button, I've put some code:
var theURLParam = fd.getUrlParam(window.location.href, 'Source');
var theRootFolder = fd.getUrlParam(window.location.href, 'RootFolder');
var theURI = theURLParam+'&RootFolder='+theRootFolder;
alert(theURI);
fd.sourceFormParam(theURI);
var theSourceForm = fd.sourceFormParam();
alert(theSourceForm);
via the alert(theSourceForm); I can confirm that the URI is correct. It contains the complete source needed, but it eventually returns to the error page.
I don't see anything of interest in the DEV console.
If I put the full URL for this particular docset into the "redirect after cancellation URL:", it works fine.
https://<SPONLINE.COM>/sites/DEVPIPCopy/PIPPRDPIPProjectDocuments/Forms/PIPDocSet/docsethomepage.aspx?ID=83&RootFolder=/sites/DEVPIPCopy/PIPPRDPIPProjectDocuments/PIP18
Hoping I just missed something silly.
Thanks!
Victor