<?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: Adding Username to a field</title><link>https://www.infopathdev.com:443/forums/thread/4274.aspx</link><pubDate>Fri, 16 Mar 2007 10:32:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4274</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4274.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4274</wfw:commentRss><description>Hi again,&lt;br /&gt;here may be a small explanation.&lt;br /&gt;&lt;br /&gt;With the first "for" statement you can create new repeating sections.&lt;br /&gt;Put a repeating section (name Result for top node and Results for repeating node) to your form and add one textbox control to it.&lt;br /&gt;Put a button to your form and copy the code (after conversion though) into your onClick event of the Button.&lt;br /&gt;Then change yourUserName-ApprovalCount to the number 4 within your the for statement.&lt;br /&gt;Preview your form and click the button, then it should actually generate 3 additional section including a textbox control. Each of this repeating section has an index or lets call it position starting from 1 i think.&lt;br /&gt;&lt;br /&gt;The second "for" statment now is used to fill data into the textbox control within your repeating section.&lt;br /&gt;So this means nothing more then iterating through your sections.&lt;br /&gt;&lt;pre&gt;thisXDocument.DOM.selectSingleNode("my:myFields/my:Result/my:Results[" + j + "]/my:nameOfTextBoxControlWithinYourSection")&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The "j" is actually the position or index of your repeating section so if this value is 3 for example you will wirte a value into the textbox control of your third section.&lt;br /&gt;&lt;br /&gt;Does this help you understanding it a bit better ?</description></item><item><title>Re: Adding Username to a field</title><link>https://www.infopathdev.com:443/forums/thread/4273.aspx</link><pubDate>Fri, 16 Mar 2007 10:02:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4273</guid><dc:creator>stumbler</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4273.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4273</wfw:commentRss><description>Thanks for the reply, &lt;br /&gt;but I will need some time to understand your suggestion and do the conversion. &lt;br /&gt;Anyhow, I have a whole weekend ahead to figure out what is all about.&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Adding Username to a field</title><link>https://www.infopathdev.com:443/forums/thread/4272.aspx</link><pubDate>Fri, 16 Mar 2007 09:55:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4272</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4272.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4272</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;you can actually create new repeating tables dynamically (so implement the "Insert Item" function:&lt;br /&gt;Below is the code example, but take care it's in C# so you have to convert it to your JScript:&lt;br /&gt;&lt;br /&gt;Use this to create a new repeating section (Result is the name of the repeating section)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;//generate as many sections as you need approvals&lt;br /&gt;for(int i = 1; i &amp;lt; yourUserName/ApprovalCount; i++)&lt;br /&gt;			{&lt;br /&gt;//create as many repeating sections as you have approvers&lt;br /&gt;				string myRepeat	= thisXDocument.DOM.selectSingleNode("my:myFields/my:Result/my:Results").xml;&lt;br /&gt;				IXMLDOMDocument oXml = thisXDocument.CreateDOM();&lt;br /&gt;				oXml.async = false;&lt;br /&gt;				oXml.loadXML(myRepeat);&lt;br /&gt;				IXMLDOMNode parentNode = thisXDocument.DOM.selectSingleNode("my:myFields/my:Result");&lt;br /&gt;				parentNode.appendChild(oXml.documentElement);&lt;br /&gt;			}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now you just need to fill the controls within you repeating sections:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for(int j = 1; j &amp;lt;= yourUserName/ApprovalCount; j++)&lt;br /&gt;{&lt;br /&gt;thisXDocument.DOM.selectSingleNode("my:myFields/my:Result/my:Results[" + j + "]/my:YourApprovalTextBoxWithinYourRepeatingSection").text= thisXDocument.Dom.SelectSingleNode("my:myFields/my:YourApproverNameTextBox").text;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Does it make any sense to you in your case ?</description></item><item><title>Adding Username to a field</title><link>https://www.infopathdev.com:443/forums/thread/1918.aspx</link><pubDate>Fri, 16 Mar 2007 08:06:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1918</guid><dc:creator>stumbler</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1918.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1918</wfw:commentRss><description>Hello,&lt;br /&gt;&lt;br /&gt;I made up an approval form that gets the username from the environment to put in the approriate field.&lt;br /&gt;But sometimes a request needs 2 approvals, so I put the approvals in a repeating table.&lt;br /&gt;But now, only the first record recieves the correct info. the second one always stays blank. I suppose it has to see with the use of current() but I would appriciate some help on this, since I don't know how to use it in this matter&lt;br /&gt;&lt;br /&gt;Here is the code I use:&lt;br /&gt;&lt;br /&gt;function msoxd__LOCALSALES_APPROVALS_EmployeeID_attr::OnAfterChange(eventObj)&lt;br /&gt;{&lt;br /&gt;//Create a WScript.Network object, which provides access to the user data&lt;br /&gt;var objNetwork = new ActiveXObject("WScript.network");&lt;br /&gt;var ApprName =objNetwork.UserName;&lt;br /&gt;var RealApprover = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:LOCALSALES/d:LOCALSALES_APPROVALS/@LoginID")&lt;br /&gt;RealApprover.text = ApprName&lt;br /&gt;&lt;br /&gt;if (eventObj.IsUndoRedo)&lt;br /&gt;		{&lt;br /&gt;			// An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;			return;&lt;br /&gt;		}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Kind Regards&lt;br /&gt;</description></item></channel></rss>