<?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: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32482.aspx</link><pubDate>Tue, 23 Sep 2008 19:49:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32482</guid><dc:creator>geolex1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32482.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32482</wfw:commentRss><description>&lt;p&gt;It worked!! Thank you so much. I appreciate your help more than you know. :)&lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32479.aspx</link><pubDate>Tue, 23 Sep 2008 18:40:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32479</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32479.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32479</wfw:commentRss><description>&lt;p&gt;Try this: oEnvelope.Subject = &amp;quot;Reduce and Pay Notification for TA: &amp;quot; + getNodeValue(&amp;quot;iss:issue/my:TA&amp;quot;);&lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32478.aspx</link><pubDate>Tue, 23 Sep 2008 18:28:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32478</guid><dc:creator>geolex1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32478.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32478</wfw:commentRss><description>&lt;p&gt;I think we&amp;#39;re getting close! I followed your suggestions and when I preview the form I do not get any more debug errors. However, when I click the submit button at the bottom, I get an error message saying &amp;quot;string is undefined.&amp;quot; Is this coming from the line below?&lt;/p&gt;
&lt;p&gt;oEnvelope.Subject = string.Format(&amp;quot;Reduce and Pay Notification for TA: {0}&amp;quot;, getNodeValue(&amp;quot;iss:issue/my:TA&amp;quot;));&lt;/p&gt;
&lt;p&gt;If so, how do I fix it? Or is &lt;em&gt;string.Format&lt;/em&gt; also for use with IP 2007 not 2003?&lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32475.aspx</link><pubDate>Tue, 23 Sep 2008 18:10:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32475</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32475.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32475</wfw:commentRss><description>&lt;p&gt;When I look at the snap of your data source, &amp;quot;my:TA&amp;quot; doesn&amp;#39;t appear to be inside any groups. The contributors folder is not expanded, but I can see &amp;quot;my:TA&amp;quot;. This would lead me to believe that &amp;quot;iss:issue/my:TA&amp;quot; would be the correct XPath.&lt;/p&gt;
&lt;p&gt;You can delete the line for string textBoxXpath, if you like. The suggestion was that you set that variable to the value of the XPath to your field, but you are using the value directly in the GetNodeValue function. However, the GetNodeValue function is written in C# for IP 2007, and you are using jscript. You already have a function in your code that you can use, though: function getNodeValue(xpath, defaultValue)&lt;/p&gt;
&lt;p&gt;Try replacing&amp;nbsp;GetNodeValue(&amp;quot;iss:issue/my:TA&amp;quot;) with getNodeValue(&amp;quot;iss:issue/my:TA&amp;quot;) and don&amp;#39;t add the method GetNodeValue to your script, as it won&amp;#39;t work for you.&lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32472.aspx</link><pubDate>Tue, 23 Sep 2008 17:56:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32472</guid><dc:creator>geolex1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32472.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32472</wfw:commentRss><description>&lt;p&gt;I used one of the sample forms because it had the code to put the form into the body of an email rather than an attachment. That&amp;#39;s where all the other elements in the data source come from. I extracted the source files and opened the template.xml file. Issue uses the namespace iss. So that would make my xpath &amp;quot;iss:issue/my:TA&amp;quot; ?? Or, since it is under the contributors folder, is it &amp;quot;iss:issue/iss:contributors/my:TA&amp;quot; ? &lt;/p&gt;
&lt;p&gt;Now that I have the xpath figured out, I assume the code I will use (based on the first reply) will be:&lt;/p&gt;
&lt;p&gt;oEnvelope.To = rgRecipients.join(&amp;quot;; &amp;quot;);&lt;br /&gt;oEnvelope.Subject = string.Format(&amp;quot;Reduce and Pay Notification for TA: {0}&amp;quot;, GetNodeValue(&amp;quot;iss:issue/my:TA&amp;quot;));&lt;br /&gt;oEnvelope.Visible = true;&lt;/p&gt;
&lt;p&gt;Question now is, where do I put the other lines he gave me (see below)? &lt;/p&gt;
&lt;p&gt;string textBoxXPath&amp;nbsp;; // please set the text box xpath into this variable textBoxXPath.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;u&gt;and&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;public string GetNodeValue(string xPath)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;IXMLDOMNode node =&amp;nbsp; thisXDocument.Dom.selectSingleNode(xPath);&lt;br /&gt;&amp;nbsp;return node.text;&lt;br /&gt;}&lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32470.aspx</link><pubDate>Tue, 23 Sep 2008 17:37:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32470</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32470.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32470</wfw:commentRss><description>&lt;p&gt;Is the form based off another schema or a DB? I ask because I see that TA uses the &amp;quot;my&amp;quot; namespace, but I&amp;#39;m not sure what namespace issue uses.&lt;/p&gt;
&lt;p&gt;You could try &amp;quot;dfs:issue/my:TA&amp;quot; if you are based off a DB....Or, you could save your form as source files (I think in IP 2003, it is under the File Menu, Extract form files) and look at template.xml to see the namespace for issue. &lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32468.aspx</link><pubDate>Tue, 23 Sep 2008 17:12:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32468</guid><dc:creator>geolex1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32468.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32468</wfw:commentRss><description>&lt;p&gt;Hi Hilary -- thanks for your help! I have posted a screenshot of the data source at &lt;a href="http://home.comcast.net/~geolex1/datasource.jpg"&gt;http://home.comcast.net/~geolex1/datasource.jpg&lt;/a&gt;. &lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32467.aspx</link><pubDate>Tue, 23 Sep 2008 16:22:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32467</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32467.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32467</wfw:commentRss><description>&lt;p&gt;Hi --&lt;/p&gt;
&lt;p&gt;A couple of things: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Your XPath should go in quotes in your code, like this &amp;quot;my:TA&amp;quot;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Your XPath is probably wrong, since most likely it is at least in a group like myFields, so &amp;quot;my:myFields/my:TA&amp;quot;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;If you are using IP 2007, you can right click on the node in the data source task pane and select Copy XPath to get the XPath to the node&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;If you don&amp;#39;t have IP 2007, post a screen shot to of your data source, and I can help you with your XPath.&lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32464.aspx</link><pubDate>Tue, 23 Sep 2008 15:41:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32464</guid><dc:creator>geolex1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32464.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32464</wfw:commentRss><description>&lt;p&gt;I sent you an email but am going to post a reply here in case anyone else can help. I&amp;#39;m still having a lot of trouble. I tried changing the code as you said above, but keep getting errors like, &amp;quot;Expected &amp;#39;)&amp;#39;&amp;nbsp;&amp;nbsp;&amp;nbsp; File:script.js&amp;nbsp;&amp;nbsp; Line:82&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oEnvelope.Subject = string.Format(&amp;quot;Reduce and Pay Notification for TA: {0}&amp;quot;, GetNodeValue(my:TA)); &amp;quot; when I try to preview the form.&lt;/p&gt;
&lt;p&gt;Like I said, I&amp;#39;m an EXTREME newbie and am not a code writer. My boss is asking for this and won&amp;#39;t let the issue go. That&amp;#39;s what happens, I guess, when you can make simple forms! Anyway, I posted the entire code of my document at &lt;a href="http://home.comcast.net/~geolex1/TAEmailCode.txt"&gt;http://home.comcast.net/~geolex1/TAEmailCode.txt&lt;/a&gt;. If anyone could take a look and let me know how I need to change it/where to insert the codes above I would really appreciate it. Also, I believe the xpath for the field I want is my:TA. I don&amp;#39;t know anything about xpath either, but from what I can gather, my:TA is it.&lt;/p&gt;
&lt;p&gt;Thanks!!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32450.aspx</link><pubDate>Tue, 23 Sep 2008 10:06:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32450</guid><dc:creator>chandrakanth</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32450.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32450</wfw:commentRss><description>&lt;p&gt;Hi Geolex,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; can you please change your code as below inorder to get the value present in text box, and appending the text box value into the email subject.&lt;/p&gt;
&lt;p&gt;string textBoxXPath&amp;nbsp;; // please set the text box xpath into this variable textBoxXPath.&lt;/p&gt;
&lt;p&gt;oEnvelope.To = rgRecipients.join(&amp;quot;; &amp;quot;);&lt;br /&gt;oEnvelope.Subject = string.Format(&amp;quot;Reduce and Pay Notification for TA: {0}&amp;quot;, GetNodeValue(textBoxXPath));&lt;br /&gt;oEnvelope.Visible = true;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;and add the below function into your code inorder to get the value in &lt;/p&gt;
&lt;p&gt;public string GetNodeValue(string xPath)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;IXMLDOMNode node =&amp;nbsp; thisXDocument.Dom.selectSingleNode(xPath);&lt;br /&gt;&amp;nbsp;return node.text;&lt;br /&gt;}&lt;/p&gt;</description></item><item><title>Add field contents to subject of email when submitting</title><link>https://www.infopathdev.com:443/forums/thread/32440.aspx</link><pubDate>Mon, 22 Sep 2008 21:24:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32440</guid><dc:creator>geolex1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32440.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32440</wfw:commentRss><description>&lt;p&gt;Hi All -- Thanks in advance for your help. I&amp;#39;m an extreme newbie.&lt;/p&gt;
&lt;p&gt;I am using the code from the Issue Tracking (detailed) sample form to submit the form as an email (in the body) rather than an attachment. Everything is working great, but I want the subject line to populate with some data from a particular field. Unfortunately I am not a code writer, so I came here for help. I&amp;#39;ve copied the relevant part of the code below. You can see where I&amp;#39;ve put in the standard text that I always want to appear (&amp;quot;Reduce and Pay Notification for TA:&amp;quot;), but after this I want it to populate from field TA (a text field) in the form. &lt;/p&gt;
&lt;p&gt;Could someone please tell me how to write this?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Geoff&lt;/p&gt;
&lt;p&gt;oEnvelope.To = rgRecipients.join(&amp;quot;; &amp;quot;);&lt;br /&gt;oEnvelope.Subject = (&amp;quot;Reduce and Pay Notification for TA:&amp;quot;); &lt;br /&gt;oEnvelope.Visible = true;&lt;/p&gt;</description></item></channel></rss>