Hi all,
I have a Filler 2013 form that I need to export to PDF when it gets approved. The requirement is that I export it to a separate site collection on the same SharePoint server where the form template will be located. I managed to figure out the Full Trust and Code Signing certificate, however, I seem to be unable to validate that the target folder that would receive the PDF actually exists.
InfoPath Filler template lives in https://[server]/resources/InfopathLib/ (which is a forms library).
InfoPath resulting XML form lives in https://[server]/resources/WF/clients/issuance/ (which is also a forms library). The user provides the client code that corresponds to the target folder but because there could be a typo, I'd like to validate the target.
Target location for the PDF is a different site collection with a URL like https://[server]/clients/c/docs/[library name]/[client folder]/
All necessary users have Collaborate permissions.
I'm looking into querying the target client folder using some type of data connection without success. Here's a code sample. I've tried (as below) to query the site collection root, the library and the client folder. With this data connection, it only goes through if I query the site collection but still the xnOutput is empty. I've tried REST with worse result; it never comes back from the Execute statement and I have to close the form.
Anyone can offer some insight on what I'm doing wrong? or is there a really simple way to verify the presence of a target folder on SharePoint?
XPathNavigator xnOutput = CreateOutputXml();
SharePointListRWQueryConnection sq = (SharePointListRWQueryConnection)this.DataConnections["ClientLib"];
sq.SiteUrl = new Uri(this.ServerInfo.SharePointServerRootUrl.ToString() + "Clients/c/docs");
try
{
sq.Execute(xnOutput);
MessageBox.Show("Result1: " + xnOutput.OuterXml);
//this works but does not return anything
}
catch (Exception)
{
MessageBox.Show("Catch1: " + xnOutput.OuterXml);
}