<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52186.aspx</link><pubDate>Thu, 25 Feb 2010 10:34:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52186</guid><dc:creator>TerryB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52186.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52186</wfw:commentRss><description>&lt;p&gt;Hilary, Brilliant! this will be a major enabler for us.&lt;/p&gt;
&lt;p&gt;It works in jscript with the following code:-&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;function&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; OpenNewFormandPassData::OnClick(eventObj)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; fred = Application.XDocuments.NewFromSolution(&amp;quot;C:\\MyForm.xsn&amp;quot;); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Open new form&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; source = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:test&amp;quot;).text; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// get local DOM node&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; MyFormDOM = fred.DOM; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// set newly opened form var&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;MyFormDOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, &amp;quot;xmlns:my=\&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-02-24T17:38:16\&amp;quot;&amp;quot;); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// sort out Namespace&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;MyFormDOM.selectSingleNode(&amp;quot;/my:myFields/my:employee&amp;quot;).text = source; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// set the new form node = node from local DOM&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52164.aspx</link><pubDate>Wed, 24 Feb 2010 23:06:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52164</guid><dc:creator>TerryB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52164.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52164</wfw:commentRss><description>2003 with jscript is my environment</description></item><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52163.aspx</link><pubDate>Wed, 24 Feb 2010 23:04:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52163</guid><dc:creator>TerryB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52163.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52163</wfw:commentRss><description>Hilary - thanks I&amp;#39;ll check this out in the morning and get back to you</description></item><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52160.aspx</link><pubDate>Wed, 24 Feb 2010 22:50:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52160</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52160.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52160</wfw:commentRss><description>&lt;p&gt;Here is a sample for the IP 2003 model -- this is C#, and I think you may be using script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font color="#008000" face="Courier New"&gt;//Create the new, blank workorder -- path changes according to your template location&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;XDocument workOrder = thisApplication.XDocuments.NewFromSolution(&lt;font color="#a31515"&gt;@&amp;quot;C:\ComputerName\Folder\TemplateName.xsn&amp;quot;&lt;/font&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;&lt;font color="#008000"&gt;//Convert to IXMLDOMDocument2&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;IXMLDOMDocument2 workOrderDOM = (IXMLDOMDocument2)workOrder.DOM;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;&lt;font color="#008000"&gt;//Set the namespace -- changes according to YOUR form&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;workOrderDOM.setProperty(&lt;font color="#a31515"&gt;&amp;quot;SelectionNamespaces&amp;quot;&lt;/font&gt;, &lt;font color="#a31515"&gt;&amp;quot;xmlns:my=\&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-07-06T22:11:15\&amp;quot;&amp;quot;&lt;/font&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font color="#000000" face="Verdana"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;&lt;font color="#008000"&gt;//Set a field -- xpath changes according to your target form&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT:normal;MARGIN-TOP:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;MARGIN-BOTTOM:0pt;FONT-SIZE:11pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Courier New"&gt;workOrderDOM.selectSingleNode(&lt;font color="#a31515"&gt;&amp;quot;/my:WorkOrders/my:EstimateId&amp;quot;&lt;/font&gt;).text = &lt;font color="#a31515"&gt;&amp;quot;SomeValue&amp;quot;&lt;/font&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Search the forum for NewFromSolution to find other samples, I think there may be some script samples out there....&lt;/p&gt;</description></item><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52157.aspx</link><pubDate>Wed, 24 Feb 2010 22:40:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52157</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52157.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52157</wfw:commentRss><description>&lt;p&gt;What object model are you using? 2003 or 2007? You can open a form from another and populate values into the newly opened form -- the code will vary depending on your object model...&lt;/p&gt;</description></item><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52152.aspx</link><pubDate>Wed, 24 Feb 2010 21:02:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52152</guid><dc:creator>TerryB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52152.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52152</wfw:commentRss><description>Perhaps it might help if I explain why I want to do this

I want to be able to pass data from the first form to the second a little like how i think Application.XDocuments.NewFromSolutionWithData works (which I&amp;#39;m also trying to get working).

However, if I can&amp;#39;t I can use the fix of knowing how the form was opened. If I knew this, I could from the trigger form (Estimate) use web services to create an entry on a sharepoint list that the other form Work Order (if it was opened from Estimate) would read and pre-populate some fields.

Cheers.</description></item><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52142.aspx</link><pubDate>Wed, 24 Feb 2010 19:09:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52142</guid><dc:creator>TerryB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52142.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52142</wfw:commentRss><description>&lt;p&gt;Thanks for the quick response - I won&amp;#39; sleep tonight if I don&amp;#39;t figure this out :-)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I fully understand!!&lt;/p&gt;
&lt;p&gt;node &amp;quot;OpenedFromEstimate&amp;quot; is part of the Work Order xsn DOM - how can I set this from the Estimate xsn DOM?&lt;/p&gt;</description></item><item><title>Re: Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52138.aspx</link><pubDate>Wed, 24 Feb 2010 18:53:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52138</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52138.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52138</wfw:commentRss><description>&lt;p&gt;Hi --&lt;/p&gt;
&lt;p&gt;So you are trying to find out in your newly opened form whether it was opened from another form or not?&lt;/p&gt;
&lt;p&gt;I&amp;#39;d add a field or attribute to your target the form that you can set when you use code to open it. To try to make this more understandable, let&amp;#39;s say I have two forms: Estimate and Work Order. I want to be able to click a button in my Estimate to open a Work Order. I also want to be able to just open the Work Order form on its own. I need to know if the Work Order was opened from the Estimate, or on its own. I&amp;#39;d add a field to Work Order called something dorky like &amp;quot;OpenedFromEstimate&amp;quot; and make it a boolean with a default value of false. Then, in my code for my Estimate button, I&amp;#39;d set the value of that field to true when I open the form from the Estimate.&lt;/p&gt;
&lt;p&gt;Does that make sense?&lt;/p&gt;</description></item><item><title>Establish how the form was opened!!</title><link>https://www.infopathdev.com:443/forums/thread/52136.aspx</link><pubDate>Wed, 24 Feb 2010 18:43:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52136</guid><dc:creator>TerryB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52136.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=52136</wfw:commentRss><description>&lt;p&gt;Hi, I&amp;#39;m trying to establish how an infopath form was opened.&lt;/p&gt;Is it possible to establish if a form was opened using &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; fred = Application.XDocuments.Open(&amp;quot;C:\\form1.xml&amp;quot;);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;from another form or if it was opened direct by clicking on it?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>