<?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: Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38697.aspx</link><pubDate>Fri, 20 Feb 2009 15:30:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38697</guid><dc:creator>martinpalmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38697.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38697</wfw:commentRss><description>&lt;p&gt;That did it.&amp;nbsp; Thanks again!&lt;/p&gt;</description></item><item><title>Re: Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38667.aspx</link><pubDate>Fri, 20 Feb 2009 05:08:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38667</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38667.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38667</wfw:commentRss><description>&lt;p&gt;//my:FirstName, //my:LastName, etc. are absolute paths that resolve to the first node in the entire data source with that name.&amp;nbsp; Please try replacing&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;firstname = oItem.selectSingleNode(&amp;quot;//my:FirstName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastname = oItem.selectSingleNode(&amp;quot;//my:LastName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit = oItem.selectSingleNode(&amp;quot;//my:UnitCode&amp;quot;).text&lt;/p&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstname = oItem.selectSingleNode(&amp;quot;my:FirstName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastname = oItem.selectSingleNode(&amp;quot;my:LastName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit = oItem.selectSingleNode(&amp;quot;my:UnitCode&amp;quot;).text&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38657.aspx</link><pubDate>Thu, 19 Feb 2009 23:58:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38657</guid><dc:creator>martinpalmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38657.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38657</wfw:commentRss><description>&lt;p&gt;Jimmy, &lt;/p&gt;
&lt;p&gt;Now that my AD query is working in the repeating table, I want to be able to pull some data out of the table.&amp;nbsp; I have looked at so many entries on this, it just gets confusing.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;What I would like to do is iterate through the repeating table, pulling each row out as assigning them to a single value to pass to a custom email message.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ie. StudentName = LastName + &amp;quot;, &amp;quot; FirstName + &amp;quot; -- &amp;quot; ID&lt;/p&gt;
&lt;p&gt;The code I have looks like this but I just cant get it to work past the first entry in the table.&amp;nbsp; It does know that there are two entries in the table though so thats helpful. &lt;/p&gt;
&lt;p&gt;dim firstname, lastname, unit&lt;br /&gt;Dim objXMLNodes, oItem&lt;br /&gt;set objXMLNodes = XDocument.DOM.selectNodes(&amp;quot;//my:StudentList&amp;quot;)&amp;nbsp; &lt;/p&gt;
&lt;p&gt;If objXMLNodes.length &amp;gt; 0 Then &lt;br /&gt;&amp;nbsp;For Each oItem In objXMLNodes&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstname = oItem.selectSingleNode(&amp;quot;//my:FirstName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastname = oItem.selectSingleNode(&amp;quot;//my:LastName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit = oItem.selectSingleNode(&amp;quot;//my:UnitCode&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; emailmessage = emailmessage + &amp;quot;Student -- &amp;quot; + lastname + &amp;quot;, &amp;quot; &amp;amp; _ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + firstname + &amp;quot; -- &amp;quot; + unit + chr(10) &lt;br /&gt;&amp;nbsp; next&lt;br /&gt;End If&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38580.aspx</link><pubDate>Wed, 18 Feb 2009 17:28:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38580</guid><dc:creator>martinpalmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38580.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38580</wfw:commentRss><description>&lt;p&gt;Worked great!! &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you so much!!!&lt;/p&gt;</description></item><item><title>Re: Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38538.aspx</link><pubDate>Wed, 18 Feb 2009 03:03:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38538</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38538.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38538</wfw:commentRss><description>&lt;p&gt;Yes,&amp;nbsp;thank you.&amp;nbsp; I just noticed that your code is&amp;nbsp;in an OnAfterChange event handler, so you don&amp;#39;t need a&amp;nbsp;loop.&lt;/p&gt;
&lt;p&gt;Please try the following:&lt;/p&gt;
&lt;p&gt;Replace&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; empid = XDocument.DOM.selectSingleNode(&amp;quot;//my:Prefix&amp;quot;).Text&lt;/p&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;empid = eventObj.Site.text&lt;/p&gt;
&lt;p&gt;And replace&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.DOM.selectSingleNode(&amp;quot;//my:FirstName&amp;quot;).Text = oRecordSet.fields &amp;amp; _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;quot;givenname&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.DOM.selectSingleNode(&amp;quot;//my:LastName&amp;quot;).Text = oRecordSet.fields(&amp;quot;sn&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.DOM.selectSingleNode(&amp;quot;//my:UnitCode&amp;quot;).Text = left(oRecordSet.fields &amp;amp; _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;quot;department&amp;quot;), 5)&lt;/p&gt;
&lt;p&gt;With&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eventObj.Site.selectSingleNode(&amp;quot;../my:FirstName&amp;quot;).Text = oRecordSet.fields &amp;amp; _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;quot;givenname&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eventObj.Site.selectSingleNode(&amp;quot;../my:LastName&amp;quot;).Text = oRecordSet.fields(&amp;quot;sn&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eventObj.Site.selectSingleNode(&amp;quot;../my:UnitCode&amp;quot;).Text = left(oRecordSet.fields &amp;amp; _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;quot;department&amp;quot;), 5)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;That should do what&amp;nbsp;you want it to do.&lt;/p&gt;
&lt;p&gt;Just as a comment, the auto-generated part:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If eventObj.IsUndoRedo Then&lt;br /&gt;&amp;#39; An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&lt;br /&gt;should really be at the top of the subroutine, not at the bottom.&lt;/p&gt;</description></item><item><title>Re: Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38519.aspx</link><pubDate>Tue, 17 Feb 2009 16:52:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38519</guid><dc:creator>martinpalmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38519.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38519</wfw:commentRss><description>&lt;p&gt;I think this is what you are looking for...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;my:myFields xmlns:xsi=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;quot; xmlns:xhtml=&amp;quot;&lt;a href="http://www.w3.org/1999/xhtml"&gt;http://www.w3.org/1999/xhtml&lt;/a&gt;&amp;quot; xmlns:dfs=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"&gt;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&lt;/a&gt;&amp;quot; xmlns:d=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"&gt;http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&lt;/a&gt;&amp;quot; xmlns:s0=&amp;quot;&lt;a href="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService"&gt;http://microsoft.com/webservices/SharePointPortalServer/UserProfileService&lt;/a&gt;&amp;quot; xmlns:s1=&amp;quot;&lt;a href="http://microsoft.com/wsdl/types/"&gt;http://microsoft.com/wsdl/types/&lt;/a&gt;&amp;quot; xmlns:mime=&amp;quot;&lt;a href="http://schemas.xmlsoap.org/wsdl/mime/"&gt;http://schemas.xmlsoap.org/wsdl/mime/&lt;/a&gt;&amp;quot; xmlns:tm=&amp;quot;&lt;a href="http://microsoft.com/wsdl/mime/textMatching/"&gt;http://microsoft.com/wsdl/mime/textMatching/&lt;/a&gt;&amp;quot; xmlns:soapenc=&amp;quot;&lt;a href="http://schemas.xmlsoap.org/soap/encoding/"&gt;http://schemas.xmlsoap.org/soap/encoding/&lt;/a&gt;&amp;quot; xmlns:soap=&amp;quot;&lt;a href="http://schemas.xmlsoap.org/wsdl/soap/"&gt;http://schemas.xmlsoap.org/wsdl/soap/&lt;/a&gt;&amp;quot; xmlns:http=&amp;quot;&lt;a href="http://schemas.xmlsoap.org/wsdl/http/"&gt;http://schemas.xmlsoap.org/wsdl/http/&lt;/a&gt;&amp;quot; xmlns:ns1=&amp;quot;&lt;a href="http://schemas.xmlsoap.org/wsdl/"&gt;http://schemas.xmlsoap.org/wsdl/&lt;/a&gt;&amp;quot; xmlns:my=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-01T21:36:18"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-06-01T21:36:18&lt;/a&gt;&amp;quot; xmlns:xd=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003"&gt;http://schemas.microsoft.com/office/infopath/2003&lt;/a&gt;&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:Global&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:IsSubmitted&amp;gt;false&amp;lt;/my:IsSubmitted&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:FileName&amp;gt;&amp;lt;/my:FileName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:RequestDate xsi:nil=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/my:RequestDate&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/my:Global&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:RequestorInfo&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Requestor&amp;gt;&amp;lt;/my:Requestor&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Phone&amp;gt;&amp;lt;/my:Phone&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Unit&amp;gt;&amp;lt;/my:Unit&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Email&amp;gt;&amp;lt;/my:Email&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Title&amp;gt;&amp;lt;/my:Title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:ReqLocation&amp;gt;&amp;lt;/my:ReqLocation&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:MgmtCode&amp;gt;&amp;lt;/my:MgmtCode&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:CoSA&amp;gt;&amp;lt;/my:CoSA&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Manager&amp;gt;&amp;lt;/my:Manager&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/my:RequestorInfo&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;my:Data&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Text&amp;gt;&amp;lt;/my:Text&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:RichText&amp;gt;&amp;lt;/my:RichText&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:DropDown&amp;gt;&amp;lt;/my:DropDown&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:List&amp;gt;&amp;lt;/my:List&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:DatePicker xsi:nil=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/my:DatePicker&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:ShowSection&amp;gt;true&amp;lt;/my:ShowSection&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:StartDate&amp;gt;&amp;lt;/my:StartDate&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:DSAListing&amp;gt;&amp;lt;/my:DSAListing&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:ClassType&amp;gt;1&amp;lt;/my:ClassType&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:ClassLocation&amp;gt;&amp;lt;/my:ClassLocation&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:Room&amp;gt;&amp;lt;/my:Room&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:ClassCode&amp;gt;&amp;lt;/my:ClassCode&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:AllianceType&amp;gt;&amp;lt;/my:AllianceType&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:AlliancePartner&amp;gt;false&amp;lt;/my:AlliancePartner&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;my:StudentList&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:Prefix&amp;gt;&amp;lt;/my:Prefix&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:FirstName&amp;gt;&amp;lt;/my:FirstName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:LastName&amp;gt;&amp;lt;/my:LastName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:UnitCode&amp;gt;&amp;lt;/my:UnitCode&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;my:EmpType&amp;gt;&amp;lt;/my:EmpType&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/my:StudentList&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/my:Data&amp;gt;&lt;br /&gt;&amp;lt;/my:myFields&amp;gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38506.aspx</link><pubDate>Tue, 17 Feb 2009 15:37:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38506</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38506.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38506</wfw:commentRss><description>&lt;p&gt;What you want to do is easy enough.&amp;nbsp; You&amp;#39;ll just need to use a loop.&amp;nbsp; I or someone else here can show you how do to that, but before that, could you describe your data source with a bit more detail? i.e., could you give the full paths from the top node down to your my:Prefix, my:FirstName, my:LastName and my:UnitCode nodes?&lt;/p&gt;</description></item><item><title>Run a scipt against a field in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/38503.aspx</link><pubDate>Tue, 17 Feb 2009 15:06:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38503</guid><dc:creator>martinpalmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38503.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=38503</wfw:commentRss><description>&lt;p&gt;All, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am a new to InforPath and code behind it and I need a little help.&amp;nbsp; I have an InfoPath 2003 for with a repeating table with 4 columns.&amp;nbsp; The first field is the employee ID (Prefix).&amp;nbsp; The script I have takes this ID, through an OnAfterChange&amp;nbsp;event, and finds the First name, Last name and unit number from active directory and populates the appropriate fields in the table.&amp;nbsp; The script works great for the first row but does not work on the following rows.&amp;nbsp; What can I do to make this script execute for each row?&amp;nbsp; Below is the code used thats works for the first row but not the following rows.&amp;nbsp; &lt;/p&gt;&lt;pre class="prettyprint" id="codeSnippet252969"&gt;Sub msoxd_my_Prefix_OnAfterChange(eventObj)
 
    empid = XDocument.DOM.selectSingleNode(&amp;quot;//my:Prefix&amp;quot;).Text
    On Error Resume Next
    Const ADS_SCOPE_SUBTREE = 2
 
    Set oRootDSE = GetObject(&amp;quot;LDAP://rootDSE&amp;quot;)
    Set oConnection = CreateObject(&amp;quot;ADODB.Connection&amp;quot;)
    Set oCommand =   CreateObject(&amp;quot;ADODB.Command&amp;quot;)
    oConnection.Provider = &amp;quot;ADsDSOObject&amp;quot;
    oConnection.Open &amp;quot;Active Directory Provider&amp;quot;
    Set oCommand.ActiveConnection = oConnection
 
    oCommand.CommandText = &amp;quot;&amp;lt;LDAP://&amp;quot; &amp;amp; oRootDSE.Get(&amp;quot;defaultNamingContext&amp;quot;) &amp;amp; _
         &amp;quot;&amp;gt;;(&amp;amp;(objectCategory=User)(sAMAccountName=&amp;quot; &amp;amp; empid &amp;amp; &amp;quot;));givenname, sn, &amp;amp; _
         department;subtree&amp;quot;
        
    Set oRecordSet = oCommand.Execute
    XDocument.DOM.selectSingleNode(&amp;quot;//my:FirstName&amp;quot;).Text = oRecordSet.fields &amp;amp; _
          (&amp;quot;givenname&amp;quot;)
    XDocument.DOM.selectSingleNode(&amp;quot;//my:LastName&amp;quot;).Text = oRecordSet.fields(&amp;quot;sn&amp;quot;)
    XDocument.DOM.selectSingleNode(&amp;quot;//my:UnitCode&amp;quot;).Text = left(oRecordSet.fields &amp;amp; _
          (&amp;quot;department&amp;quot;), 5)
 
    oConnection.Close
    Set oRecordSet = Nothing
    Set oCommand = Nothing
    Set oConnection = Nothing
    Set oRootDSE = Nothing
 
    If eventObj.IsUndoRedo Then
	&amp;#39; An undo or redo operation has occurred and the DOM is read-only.
           Exit Sub
    End If
 
End Sub
&lt;/pre&gt;</description></item></channel></rss>