3

We designed a browser enabled InfoPath form.

When the user visits the form for the first time, they must click on agree button. When they click on Agree button and consecutive visits they go to a different view within the same form.

On the second view, the users should be able to click on a button and get redirected to another page.

We do steps of this articles

http://site/list1/?Source=redirect url


Source=<URL to redirect to after submission>

but in sharepoint we can make a link but in info path we cant make it? without any code

InfoPath form: How to redirect to the previous page after pressing on the submit button?

1

This is an expansion to Kirill's answer. If there are alternatives I am unaware of them.

However one thing that was not mentioned is that it seems that the source url MUST be in the same site collection. I tried and failed with the same web application, was collection only.

Here is an example URL of what is needed.

http://www.yoursharepointsite.com/yoursubsite/_layouts/FormServer.aspx?XsnLocation=http://www.yoursharepointsite.com/yoursubsite/Form%20Demo/Forms/template.xsn&SaveLocation=http%3A%2F%2Fwww%2Eyoursharepointsite%2Ecom%2Fyoursubsite%2FForm%20Demo&ClientInstalled=true&Source=http%3A%2F%2Fwww%2Eyoursharepointsite%2Ecom&DefaultItemOpen=1

To get that particular URL I had a form library set up so that my custom form loaded into the browser. I then opened the form using the "Add document" button and the following URL was in the navigation bar.

http://www.yoursharepointsite.com/yoursubsite/_layouts/FormServer.aspx?XsnLocation=http://www.yoursharepointsite.com/yoursubsite/Form%20Demo/Forms/template.xsn&SaveLocation=http%3A%2F%2Fwww%2Eyoursharepointsite%2Ecom%2Fyoursubsite%2FForm%20Demo&ClientInstalled=true&Source=http%3A%2F%2Fwww%2Eyoursharepointsite%2Ecom%2Fyoursubsite%2FForm%20Demo%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1

I'll chop this up real quick.

http://www.yoursharepointsite.com/yoursubsite/_layouts/FormServer.aspx

Notice the end of it, I don't know if FormServer.aspx is standard. Personally I am already embedding them in the browser so I just get what they give.

XsnLocation=http://www.yoursharepointsite.com/yoursubsite/Form%20Demo/Forms/template.xsn

thats where the infopath file is stored. Again with the way I do it this is auto-populated.

SaveLocation=http%3A%2F%2Fwww%2Eyoursharepointsite%2Ecom%2Fyoursubsite%2FForm%20Demo&

Destination for the save file, not sure if this has implications for submit as well (likely not), also can't say what happens if removed. We only have need of submit for now. Again my method auto-populates.

ClientInstalled=true

I'm guessing this indicates if the InfoPath program has been detected on the computer. (Fun fact, we had an issue where it was not detected if it had never been run before, was causing SharePoint issues as it then defaults to in browser even if the form isn't set up for it). Auto-populated but likely irrelevant if your embedding in browser (though again not very familiar)

Source=http%3A%2F%2Fwww%2Eyoursharepointsite%2Ecom%2Fyoursubsite%2FForm%20Demo%2FForms%2FAllItems%2Easpx

This is where the person will be taken in the browser after. It must be in the site collection, it can be site relative rather than absolute (have not messed around with that personally). If the URL is valid when the form is closed either after submission or by hitting the "close" button, then it will navigate to that url. If the URL is invalid then the form will stop at a screen that says "Form is closed" and will not go anywhere. Again this was tried with outside urls like google, and also other urls within the same web applications. Site collection only with this method.

However, if the form is designed to open in InfoPath the program (as in launches the program) then as soon as the url is entered InfoPath will load, at the same time the tab you used to enter the URL will navigate to this url.

DefaultItemOpen=1

SharePoint uses this with all their programs to determine how to open a link. using "1" indicates the file should be opened in the browser (remember the InfoPath form is a file), using "0" indicates the file should be opened in the client application.

Also be aware of the character encoding. I was able to use the normal characters in IE9 when typing in the url, but I imagine this is not universal.

1

Not sure if I understood your question, but if think this is what you need.

I hope you are designing a form template, go ahead and open the form template and click where you want to insert the link, or select the text that you want to turn into a hyperlink. On the Standard toolbar, click Insert Hyperlink Button image, or press CTRL+K. In the Address box, type the URL that you want to link to.

But if you are trying to redirect them to a Web Page after they Submit and Close the form Source=<URL to redirect to after submission> is the only option. You have to create the link for users to click and open the InfoPath for data entry. In that link add the Source=<URL to redirect to after submission>. It should work.

1

If you want to do it without any code, source parameter with url is the only option. You can pass on a user to another page by adding '&Source=http://somewhere.com' to the end of the url that opens up the form, and when user press 'Submit', it will redirect to 'http://somewhere.com'. Be aware, if user press 'Cancel', it will redirect too.

  • Please add more details to this answer – Robert Lindgren Mar 4 '14 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.