1
votes

I have SharePoint form Library, and InfoPath form with 1 text field. My problem is, that i need to get somehow lib. URL of Form Library and set it to the text box f.g

string _s = this.aplication.activeForm.GetUrlOfLibrabry();

How to get parent lib URL? (form is opened in INFOPATH not in browser)

2

2 Answers

1
votes

I'm not sure for InfoPath 2007, but for 2010 you have the form library URL available in the querystring. I recommend that you do the following:

  1. Inside the FormEvents_Loading method get the querystring parameter.

    if (eventArguments.InputParameters.ContainsKey("SaveLocation")) { var docLib = HttpUtility.UrlDecode(eventArguments.InputParameters["SaveLocation"]); }

  2. Save the Url in a InfoPath hidden field so you can read it later (_spListUrl in this case).

    // store into xml data

    XPathNavigator navigator= nav.SelectSingleNode("my:myFields/my:_spListUrl", NamespaceManager); navigator.SetValue(sDocLib);

I hope this helps

1
votes

Sebastian, have you tried:

this.ServerInfo

this will give you lots of methods that you can query (i.e. SharePointListUrl, etc...)