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)
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:
Inside the FormEvents_Loading method get the querystring parameter.
if (eventArguments.InputParameters.ContainsKey(“SaveLocation”))
{
var docLib = HttpUtility.UrlDecode(eventArguments.InputParameters[“SaveLocation”]);
}
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