Cancel Button Redirect Source

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
fishvict
Posts: 8
Joined: Tue Dec 18, 2018

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

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

31 Jan 2019

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.

fishvict
Posts: 8
Joined: Tue Dec 18, 2018

31 Jan 2019

I've sent you a sharing link. Thanks for taking a look. Its a development site, so no worries about poking around.
Sincerely,
Victor Fisher

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

31 Jan 2019

Dear Victor,

As far as I see, your final link is https://<SPONLINE.COM>/sites/DEVPIPCopy/PIPPRDPIPProjectDocuments/Forms/PIPDocSet/docsethomepage.aspx?ID=83

You need to add a RootFolder and List parameters to successfully redirect.

fishvict
Posts: 8
Joined: Tue Dec 18, 2018

01 Feb 2019

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

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

04 Feb 2019

Dear Victor,

Is the issue still actual? I've visited your site to research the issue and noticed that you've changed your implementation.

fishvict
Posts: 8
Joined: Tue Dec 18, 2018

05 Feb 2019

Well, I haven't stopped what other development I can do (as this project is getting close to overdue) but I have not touched neither the form nor the record (83) for testing this issue. The issue still does exist.

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

05 Feb 2019

Dear Victor,

Yes, I'm sorry, I've visited the wrong List. We are researching your issue.

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

07 Feb 2019

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

fishvict
Posts: 8
Joined: Tue Dec 18, 2018

07 Feb 2019

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.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests