Cancel Button Redirect Source
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
Dear Victor,
I'm sorry, I can't reproduce your issue, could you please provide temporary access in the private message?
You can either share a site with an external user (azverev@180821.onmicrosoft.com): https://docs.microsoft.com/en-us/sharep ... g-overview
Or provide credentials of one of the existing users - then you can change the password.
I'm sorry, I can't reproduce your issue, could you please provide temporary access in the private message?
You can either share a site with an external user (azverev@180821.onmicrosoft.com): https://docs.microsoft.com/en-us/sharep ... g-overview
Or provide credentials of one of the existing users - then you can change the password.
I did do that, but the form seems to be ignoring it...
I put this code into the Cancel button (as noted above). See my notes in bold, below.
Should i be putting the code elsewhere?
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; <-- right here I create the new URI
alert(theURI);
fd.sourceFormParam(theURI); <-- right here I set it
var theSourceForm = fd.sourceFormParam(); <-- right here I check the URI (doc says that if call this without params, it brings back the current stting)
alert(theSourceForm);
thanks,
Victor
I put this code into the Cancel button (as noted above). See my notes in bold, below.
Should i be putting the code elsewhere?
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; <-- right here I create the new URI
alert(theURI);
fd.sourceFormParam(theURI); <-- right here I set it
var theSourceForm = fd.sourceFormParam(); <-- right here I check the URI (doc says that if call this without params, it brings back the current stting)
alert(theSourceForm);
thanks,
Victor
Dear Victor,
The issue is that the Source parameter in the "Edit Request" is not encoded. It contains "&" which are not encoded, so it's not clear if the remaining params belong to the Source or to the Form URL.
This is the right link to the form, you can check it: https://gsiccorp.sharepoint.com/sites/D ... %252FPIP18
The issue is that the Source parameter in the "Edit Request" is not encoded. It contains "&" which are not encoded, so it's not clear if the remaining params belong to the Source or to the Form URL.
This is the right link to the form, you can check it: https://gsiccorp.sharepoint.com/sites/D ... %252FPIP18
AHHH! thank you! I knew it was something I was missing. This is what I get for deciding to do coding again after 15 years of not doing it.
I appreciate you looking into this. We love the tool here... its getting used quite a bit now that we're moving from On-Prem to Online.
thanks again.
I appreciate you looking into this. We love the tool here... its getting used quite a bit now that we're moving from On-Prem to Online.
thanks again.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 14 guests