Inserting a specific number of repeating sections on load - InfoPath Dev
in

InfoPath Dev

Inserting a specific number of repeating sections on load

Last post 09-08-2011 08:32 AM by rbeibv. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 09-08-2011 06:41 AM

    • rbeibv
    • Not Ranked
    • Joined on 09-08-2011
    • Posts 5

    Inserting a specific number of repeating sections on load

    I would like to be able to insert a defined number of repeating sections automatically as opposed to having the user select insert item each time. My example is i am designing a form for each of our companies to submit there cash info by bank account. Depending on the location they may have 2 or 3 or 4 bank accounts. As the form functions now they have to click insert item for each account they wish to submit. I would like to be able to load the form and have it automatically display the correct number of sections. Any help will be appreciated.
    Filed under:
  • 09-08-2011 07:12 AM In reply to

    Re: Inserting a specific number of repeating sections on load

    The form's Default Values dialog would work for starting off new forms with specific number of sections in each of its repeating groups.  Is that what you're looking for, or do you need something more dynamic?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-08-2011 07:14 AM In reply to

    • rbeibv
    • Not Ranked
    • Joined on 09-08-2011
    • Posts 5

    Re: Inserting a specific number of repeating sections on load

    Starting off would work as i know in advance how many sections i need inserted for each subsidiary. I use SharePoint to provide the forms so i can select the view based on the user role and load their specific view.
  • 09-08-2011 07:36 AM In reply to

    Re: Inserting a specific number of repeating sections on load

    Well, the Default Values dialog applies to the whole form, not the individual views.  Would it be an option to by default have the most sections you could need (4?) and then use conditional formatting to hide the extra ones in certain views? 

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-08-2011 07:39 AM In reply to

    • rbeibv
    • Not Ranked
    • Joined on 09-08-2011
    • Posts 5

    Re: Inserting a specific number of repeating sections on load

    yes this would work perfect. can you advise me on how to do this. Thank you.
  • 09-08-2011 07:46 AM In reply to

    Re: Inserting a specific number of repeating sections on load

    On the repeating sections, you would add conditional formatting to hide the section on the condition

    count(preceding-sibling::my:repeatingGroupName) >= numberOfSectionsToShow

    This will hide the extra sections.  You'll also want to change the repeating sections' properties to prevent users from adding or removing rows.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-08-2011 07:56 AM In reply to

    • rbeibv
    • Not Ranked
    • Joined on 09-08-2011
    • Posts 5

    Re: Inserting a specific number of repeating sections on load

    ok, so if my repeating group name is "cash" i would write the expression like this? count(preceding-sibling::my:cash) >= 4 or do i create a field called NumberOfSectionsToShow Thank you for your help.
  • 09-08-2011 08:05 AM In reply to

    Re: Inserting a specific number of repeating sections on load

    Yes, that looks right.  Remember you'll need to use the Default Values dialog (Tools->Default Values in IP 2007, Data->Default Values in 2010) to add the number of sections you want the form to start off with.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-08-2011 08:32 AM In reply to

    • rbeibv
    • Not Ranked
    • Joined on 09-08-2011
    • Posts 5

    Re: Inserting a specific number of repeating sections on load

    Well done..thank you. first time in this forum and i am very pleased..Cheers
Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.