<?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>Re: NewFromSolution problems</title><link>https://www.infopathdev.com:443/forums/thread/14387.aspx</link><pubDate>Fri, 17 Mar 2006 08:28:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14387</guid><dc:creator>danallason</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14387.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14387</wfw:commentRss><description>Thanks Agni! That now has the code compiling properly and I no longer get the error message. The problem now being that NewFromSolution doesn't open newForm (I am sure I have the filepath in the correct format). Should I be using different syntax? Any help would be great, Cheers!&lt;br /&gt;Dan</description></item><item><title>Re: NewFromSolution problems</title><link>https://www.infopathdev.com:443/forums/thread/14386.aspx</link><pubDate>Thu, 16 Mar 2006 16:02:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14386</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14386.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14386</wfw:commentRss><description>Hi Dan Allason,&lt;br /&gt;You should not give "XDocument" or "IXMLDOMNode" in script code, you should give "var" instead. That is the reason for the error message.&lt;br /&gt;One more thing in the path specified, every "\" should be escaped with another one.&lt;br /&gt;for ex: Your path should be "\\\\server\\pathname\\Timesheets.xsn"&lt;br /&gt;&lt;br /&gt;Regarding Rules and code getting called onclick, Yes they both will be called(Executed).</description></item><item><title>NewFromSolution problems</title><link>https://www.infopathdev.com:443/forums/thread/12815.aspx</link><pubDate>Wed, 15 Mar 2006 11:49:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12815</guid><dc:creator>danallason</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12815.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12815</wfw:commentRss><description>Hi All,&lt;br /&gt;&lt;br /&gt;I have created a timesheet form for our supervisors to complete for each of their subordinates on a weekly basis. The data is then submitted to a database. As an ease of use issue more than anything - I would like to have a button that says "Submit and Fill Out Another" which submits the current timesheet and opens a fresh one. This can be done with rules alone but the user is required to fill in the 'InputBy' and 'Passcode' fields each time the new form is opened.&lt;br /&gt;&lt;br /&gt;I have tried using code to open a new form and copy the above two fields into the same fields on the new form. Unfortunately, my jscript is not what one would call 'exemplary'! This means that I am at a dead end with the following code:&lt;br /&gt;&lt;br /&gt;function submitAndAddAnother::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;	//Create a new form&lt;br /&gt;	XDocument newForm = Application.XDocuments.NewFromSolution("\\server\pathname\Timesheets.xsn");&lt;br /&gt;	//Get the current InuptBy data&lt;br /&gt;	IXMLDOMNode inputByOld	= thisXDocument.DOM.selectSingleNode("/fieldPath@InputBy");&lt;br /&gt;	//Get the new InputBy field&lt;br /&gt;	IXMLDOMNode inputByNew	= newForm.DOM.selectSingleNode("/fieldPath/@InputBy");&lt;br /&gt;	//Set the new field to the value of the old field&lt;br /&gt;	inputByNew.text = InputByOld.text;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;My problem being that this doesn't work! The error I get is along the lines of:&lt;br /&gt;Expected ';'&lt;br /&gt;File:script.js&lt;br /&gt;Line:58&lt;br /&gt;Where line 58 corresponds to the line where newForm is initialised.&lt;br /&gt;&lt;br /&gt;Also - if I have rules as well as code - will they both be run at onClick? Because otherwise I will have to submit and close the old form with code too...&lt;br /&gt;&lt;br /&gt;Thanks in advance of any help offered,&lt;br /&gt;Dan Allason&lt;br /&gt;</description></item></channel></rss>