How to restrict Repeating Section - InfoPath Dev
in

InfoPath Dev

How to restrict Repeating Section

Last post 01-07-2009 07:30 AM by Alec Pojidaev. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-06-2007 07:22 AM

    How to restrict Repeating Section

    Hi All,

     I have a web enabled form built using IP 2007 running in MOSS.  This form basically is form people to submit a support ticket.  At the bottom of the form, there is a repeating section for anyone (ie. regular user and support staff) to enter comment.  It has a repeating section in it.  My questions are:

     

    1) How can I limit the repeating section to allow only one entry each time a user opens it?

    2) If I want certain fields to be filled out ONLY by support staff, how do you perform a lookup against a MOSS group or AD group?

     
    Any suggestion is appreciated.

     

    Thanks
     

  • 12-07-2007 07:36 AM In reply to

    Re: How to restrict Repeating Section

    Hey There.

    For number one I would use another field as a counter.  Have it reset on each open or for each unique user. Use a rule on insert that increments it (could be a true or false too) and then put conditional formating so that if the counter has been incremented or changed do not allow additional inserts.

    For typically use an Active Directory web service to identify each user and check their group membership on form load.  You should be able to also query SharePoint on the user but I am not familiar with this.

  • 01-06-2009 10:56 AM In reply to

    • harlme
    • Not Ranked
    • Joined on 01-06-2009
    • Posts 2

    Re: How to restrict Repeating Section

    I have a similar situation where I am trying to limit the number of inserts of a repeating section by a user.  We are using this as a stand alone form where the user will submit their data to us AND we have no development helping with this.  Due to this fact we have been instructed not to use any custom (advanced) coding on the form.  I've added a field to the repeating group to be used as a counter (default value of 1).  Then in the repeating section set up a rule to increment the counter by 1.  Then set up a conditional format to hide the control when the counter is greater than the limit.  It seems like I'm close but it still lets me insert more than what I want.  I have several sections I'd like to set this type of limit on.  Any help is appreciated.

  • 01-06-2009 02:15 PM In reply to

    Re: How to restrict Repeating Section

    I would create additional text field (lets say UserName) at the same level as your feedback field. Feedback field's rule is setting value of UserName field to the userName() function. In conditional formating properties of your repeating section i would make repeating section disable under following condition:

    contains(xdMath:Eval(xdMath:Eval(my:MyRepeatingSection, "UserName"), ".."),userName())

  • 01-07-2009 06:20 AM In reply to

    • harlme
    • Not Ranked
    • Joined on 01-06-2009
    • Posts 2

    Re: How to restrict Repeating Section

    I apologise for not understanding this, but I am having a hard time understanding why inserting a text field would solve my issue.  In my repeating section, the user can fill it out a minimum of 0 to a maximum of 10 times.  I just want to disable it after the 10th time.

     On looking at what I originally had, with a counter; I add data and add my repeating section, the counter increments to 2 (like it should).  I add some data and then add another section and the counter stays at 2 when I'm expecting it to increment to 3.  I have the rule to increment the counter on the repeating section with no condition tied to it (the rule should always apply).  I feel like I'm really close but missing something small.

  • 01-07-2009 06:47 AM In reply to

    Re: How to restrict Repeating Section

     

    Hi,

    Try out this.You can restrict the user to insert the rows by following the below steps.

    1. Go to repeating section properties. then move to display tab.

    2. Click on conditional formatting.Selct the expression in first drop down and enter the following expression

     count("repeating section xpath") = 10

    3. Check ‘Don't allow users to insert or delete this control'. Click ok.

     

     

    Hope you will understand this.

     

     

    Swathip
    www.ggktech.com
  • 01-07-2009 07:30 AM In reply to

    Re: How to restrict Repeating Section

     Sorry hadn't realized that maximum amount of replies could be any figure. Here is condition for disabling control after the limit of 10 replies is reached.

    string-lenth(xdMath:Eval(xdMath:Eval(my:MyRepeatingSection, 'substring("|", 1, number(my:UserName = userName()))', ".."))>9

    It's the same idea as in that post:

    http://www.infopathdev.com/forums/p/7124/30263.aspx

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