Changing values on repeating section - InfoPath Dev
in

InfoPath Dev

Changing values on repeating section

Last post 04-30-2006 06:19 PM by Carlos. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-27-2006 11:07 PM

    • Carlos
    • Top 500 Contributor
    • Joined on 01-24-2006
    • Australia
    • Posts 31

    Changing values on repeating section

    Sorry if this has already been discussed. I did a search and found info, but didnt help me. This should be easy for the pros tho :)

    I have a field in a repeating section (a checkbox) in which I used an onload to try and change the value of 2 fields. Code below:

    Sub XDocument_OnLoad(eventObj)
    XDocument.Query

    Set OC = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:tbl_Project/d:tbl_Outcome/@Outcome_Changed")
    Set OCN = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:tbl_Project/d:tbl_Outcome/@Outcome_Changed_Note")
    If OC.Text = "Y" Then
    OC.Text = "N"
    OCN.Text = ""
    End If
    End Sub

    Now this works a treat only for the first value, ignoring subsuquent ones. I tried to get my head around selectNodes but cant seem to get it to work. Can someone please show me what changes I need to make.

    Sorry for the lame post.

    Cheers,
  • 04-28-2006 02:14 AM In reply to

    Re: Changing values on repeating section

    Hi Carlos,
    Here is the code for selectnodes, this is in JScript

    var OC = XDocument.DOM.selectNodes("/dfs:myFields/dfs:dataFields/d:tbl_Project/d:tbl_Outcome");
    for(i=0 ; i < OC.length; i++)
    {
    if (OC.selectSingleNode("@Outcome_Changed").text = "Y")
    {
    OC.selectSingleNode("@Outcome_Changed").text = "N";
    OC.selectSingleNode("@Outcome_Changed_Note").text = "";
    }
    }
  • 04-30-2006 06:19 PM In reply to

    • Carlos
    • Top 500 Contributor
    • Joined on 01-24-2006
    • Australia
    • Posts 31

    Re: Changing values on repeating section

    Thanks Agni. I will try to convert this logic to VBScript.

    Cheers,
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.