Need to find out what document library a form was opened from

M

Mike C

I have a site collection in MOSS 2007 with a centrally managed form library.
This site collection has many sub sites. I have Infopath forms that are
available on the "New" dropdown as content types in a document library on
each sub site. What I need to know inside the form when it is opened is which
site or document library the form was opened from. These forms are being
opened in Infopath and not the browser so using the below does not work:

e.InputParameters["SaveLocation"].ToString();

Once a form is save the below works but I can not get anything to work from
the new button.

e.InputParameters["XmlLocation"].ToString();

I also tried this:

substring-before(substring-after(processing-instruction(), 'href="'), '"')

but that gives you the location where the form template exists, which is on
the parent site. Any help would be appreciated.
 
K

Karthik

Hi Mike,

My simplest logic for tackling this problem would be adding a field and have
a unique id for each of the sub site. This id would be populated in the newly
added field during OnLoad() event or wherever you want. When you want to the
previous place where the template is opened from can be got by accessing this
field and your logic goes based on the id you get.

Hope this solves your problem.

regards,
Karthik
 
M

Mike C

The problem is I have the forms set up as content types in a site template so
when new sites are created the forms are available on these sites so there is
no way for me to keep track of the sites if the user creates them.
 

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