InfoPath 2010 Filler Rolling Updates - InfoPath Dev
in

InfoPath Dev

InfoPath 2010 Filler Rolling Updates

Last post 04-28-2012 02:22 PM by mlarsen_dk. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-23-2012 11:27 PM

    • Joey_86
    • Top 500 Contributor
      Male
    • Joined on 12-23-2010
    • Sydney
    • Posts 28

    InfoPath 2010 Filler Rolling Updates

    Hi, I'm putting together a rolling updates section in my form, basically I have a field(field 1) in a scrolling region.

    This is what I would like to do:

    - Status field (field 2), Priority field (field 3) - when a user makes a selection to these fields, I use the concat option to set field 1 to 'concat(field 1, now(), " - ", translate(userName(), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), " has changed the STATUS to ", ., "")'

    - field 1 should then display the above, but if I make a selection to Priority (field 3) it displays it in the same field, is there a no code/code solution to add a new field and add the new concat in a new field above field 1 in the scrolling region but still maintain field 1 and keep the region rolling?

    Hope that makes sense, cheers

  • 04-27-2012 03:23 PM In reply to

    Re: InfoPath 2010 Filler Rolling Updates

    If your field is repeating, you can use code (or qRules) to create a new instance of the node. There is nothing in the InfoPath UI to insert a new instance of a repeating group / node, I'm afraid.

    Hilary Stoupa

  • 04-28-2012 02:22 PM In reply to

    Re: InfoPath 2010 Filler Rolling Updates

    Hi,

    Here's some code that might work for you (it's not tested, but derived from some working code I have).

    You need to make some extra nodes to hold the value when changing field 2 and field3, in this example I've called them field2_status and field3_status.

    public void field2_Changed(object sender, XmlEventArgs e)

    {

        XPathNavigator nav = CreateNavigator();

        nav.SelectSingleNode("/my:mineFelter/my:field2_status", NamespaceManager).SetValue(concat(now(), " - ", translate(userName(),"abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), " has changed the STATUS to ", ., ""));

        concatValuesWithCRLF(

          nav.SelectSingleNode("/my:mineFelter/my:field1", NamespaceManager),

          nav.SelectSingleNode("/my:mineFelter/my:field2_status", NamespaceManager)

        );

    }

    public void field3_Changed(object sender, XmlEventArgs e)

    {

        XPathNavigator nav = CreateNavigator();

        nav.SelectSingleNode("/my:mineFelter/my:field2_status", NamespaceManager).SetValue(concat(now(), " - ", translate(userName(),"abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), " has changed the STATUS to ", ., ""));

        concatValuesWithCRLF(

          nav.SelectSingleNode("/my:mineFelter/my:field1", NamespaceManager),

          nav.SelectSingleNode("/my:mineFelter/my:field2_status", NamespaceManager)

           );

    }

    public void concatValuesWithCRLF(XPathNavigator node1, XPathNavigator node2)

    {

        /* node 1 is updated with the value of node 2 */

        if (node1.Value == "")

            node1.SetValue(node2.Value);

        else

            node1.SetValue(node1.Value + "\r\n" + node2.Value);

    }

     

     

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