Hi,
I had a question that I'm wondering is possible. I wanted to be able to have a button on a form that opens a specific file on a network drive. The network drive path is all specified through group policy, so everyone will have it mapped the same way (P:\ drive in this instance). I had created a view in one field that would allow the data input person to input the file path of the file specified in, and on another view, I created a button to open the file via the default application. I deployed the form via full trust and published to my SharePoint site. For reference, the code behind the button is below (pretty simple):
public void CTRL2_5_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
XPathNavigator nav = MainDataSource.CreateNavigator();
string fieldValue = nav.SelectSingleNode("//my:myFields/my:field1", NamespaceManager).Value;
System.Diagnostics.Process.Start(fieldValue);
}
If I run this in infopath filler it works great. However, I've come to realize as I'm chasing down errors that the code is executed from the server and even if a valid file is inputted from the server's point of view, the file will not actually open on the users computer. Is there a better way to achieve what I am looking for here? I want to make working with this form as EASY as possible in order to drive adoption of this through my company, so I thought the button solution would be great. Rolling out infopath filler to everyone in my environment is not a realistic option. Does anyone have a bead one a work-around, or see what I am missing? If I am going about this in the wrong manner I'm open to any suggestions (i.e. is it possible to attach the file I want to open via button to the sharepoint form, and open it with one button push that way?, etc.). I would greatly appreciate any help anyone can offer in this regard. I am sorry for the formatting on this post, I am unclear how to format here, and unfortunately was unable to find a topic pointing me in the right direction. Thank you in advance for your time.