Submit an InfoPath form to the SharePoint library it was opened from

H

hpbolten

Here is my goal: Trying to find a (hopefully easy) way to have InfoPath
submit to the same form library from which it was opened.

The challenging part is that we are designing the form once and
publishing it according to the Approved Administrator Template process
so it is available to all sites throughout our SharePoint site
collection(s). Site Administrators will then create form libraries
based on this template for storing their own copies of the form. The
problem we are encountering is how to grab the location of the form
library from which the form was opened and then dynamically update the
"submit to" property with this information, such that when the form
is submitted it is submitted to the same library from which it was
opened.

We want to maintain the integrity of the form so there will be no
requirement for the site administrator to modify the template. Instead,
we will need to do this dynamically at runtime - most likely with
code (that works in both the browser and the InfoPath client).

The part that I don't have answer to, is how to find out from which
library the document was opened.

Thanks for any help !
 
D

darko

Hi,

The XDocument.Soulution object -> The Solution object implements properties
for getting information about a form template, including its version number,
the Uniform Resource Locator (URL) of its extracted form files, the URL it
was loaded from, and an XML Document Object Model (DOM) containing its form
definition (.xsf) file.

URI Property -> A read-only property that returns a string value containing
the Uniform Resource Identifier (URI) of a Microsoft Office InfoPath 2003
form template.
PackageURL Property -> A read-only property that returns a string containing
the Uniform Resource Locator (URL) of the cache folder that contains a
Microsoft Office InfoPath 2003 form's extracted form files.

but, you must call this in the onLoad event, and returns the url of the .xsn
template. So you need to remove the "/Form/template.xsn" from the url to get
the Form Library url.
 
H

HPB

Thank you for your help!

What I'm afraid of, is that the url that will be returned might be the
url for the central template. The libraries only point to that
template. In that case, the address that would be returned would always
be the same.

I'll try your method and tell you how it works out
 
H

HPB

Tried out the code that you posted up, and it actually points back to
the central forms library, and not to my specific library.

This does however solve some of my issues, but not completely :)

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top