<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Validate target location before exporting as PDF</title><link>https://www.infopathdev.com:443/forums/thread/116491.aspx</link><pubDate>Wed, 14 Jun 2017 18:51:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:116491</guid><dc:creator>Josee Sevigny</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/116491.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=116491</wfw:commentRss><description>&lt;p&gt;Hi all, &lt;/p&gt;
&lt;p&gt;I have a Filler 2013 form that&amp;nbsp;I need to export to PDF when it gets approved.&amp;nbsp;The requirement is that I export it to a separate site collection on the same SharePoint server where the form template will be located.&amp;nbsp; 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.&lt;/p&gt;
&lt;p&gt;InfoPath Filler template&amp;nbsp;lives in&amp;nbsp;&lt;a href="https://[server]/resources/InfopathLib/"&gt;https://[server]/resources/InfopathLib/&lt;/a&gt; (which is a forms library).&lt;br /&gt;InfoPath resulting XML form lives in &lt;a href="https://[server]/resources/WF/clients/issuance/"&gt;https://[server]/resources/WF/clients/issuance/&lt;/a&gt; (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&amp;#39;d like to validate the target.&lt;br /&gt;Target location for the PDF is a different site collection&amp;nbsp;with a URL like &lt;a href="https://[server]/clients/c/docs/[library"&gt;https://[server]/clients/c/docs/[library&lt;/a&gt; name]/[client folder]/ &lt;/p&gt;
&lt;p&gt;All necessary users&amp;nbsp;have Collaborate permissions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking into querying the target client folder using some type of data connection without success. Here&amp;#39;s a code sample. I&amp;#39;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.&amp;nbsp; I&amp;#39;ve tried REST with worse result; it never comes back from the Execute statement and I have to close the form.&lt;/p&gt;&lt;p&gt;Anyone can offer some insight on what I&amp;#39;m doing wrong? or is there a really simple way to verify the presence of a target folder on SharePoint?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;XPathNavigator xnOutput = CreateOutputXml();&lt;br /&gt;
&lt;br /&gt;SharePointListRWQueryConnection sq = (SharePointListRWQueryConnection)this.DataConnections[&amp;quot;ClientLib&amp;quot;];&lt;br /&gt;sq.SiteUrl = new Uri(this.ServerInfo.SharePointServerRootUrl.ToString() + &amp;quot;Clients/c/docs&amp;quot;); &lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq.Execute(xnOutput);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MessageBox.Show(&amp;quot;Result1: &amp;quot; + xnOutput.OuterXml);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//this works but does not return anything&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;catch (Exception)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MessageBox.Show(&amp;quot;Catch1: &amp;quot; + xnOutput.OuterXml);&lt;br /&gt;&amp;nbsp;}&amp;nbsp;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>