InfoPath repeating section rules based on button click outside of section - InfoPath Dev
in

InfoPath Dev

InfoPath repeating section rules based on button click outside of section

Last post 12-08-2014 12:06 PM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 12-08-2014 09:39 AM

    InfoPath repeating section rules based on button click outside of section

    Help!?!?!?

    Somehow I got voluntold into this project, “well he is great at Excel, so InfoPath should be no problem”. With that said this document is the first document I have created with InfoPath and SharePoint. Some background on the document, this document is used to track the life cycle of an audit (finance) so I believe there was a need for both a repeating section and a repeating table within the section. An audit may have more than 1 issue (repeating section) and the individual Action Plans can range from daily to one time reviews for up to 3 months these reviews must be documented (repeating table). I am in the final stages of this project and want to start testing but I do want to have an error check performed when the “Submit CAP to Area Director” button is clicked (if error is found the rules would stop other rules so form will not be submitted)

    Rule is as follows if “CountReviews<NumberOfReviews” then “concat("Error: Number of reviews associated with CAP ", ../my:group1/my:AddCAPPlan[current()]/my:ReferenceNumber, " is less than what is required. Based on the Date CAP started, CAP due date, and Frequency of review there should be a total of ", my:group1/my:AddCAPPlan[current()]/my:NumberOfReviews, " though only ", my:group1/my:AddCAPPlan[current()]/my:CountReviews, " have been recorded.")"

    I have also tried adding both current()/../ and [current()], tried to play with eval(eval(, though not really sure how that function works, and playing in the manifest.xsf.

    CountReviews = count(ReviewSerial) (number of rows in table)

    NumberOfReviews = Rules Based – Days between “CAPStartDate” and “CAPDueDate” divided by whatever is needed to calculate for daily, weekly, monthly, or quarterly reviews.

    This is a browser form as my end users do not have InfoPath Filler.

    At this point I would be happy with the above message to appear within the affected section but preferably I would like it outside of the section on the bottom of the form just above the buttons. I would also like the end user to either continue with the error (button to change a field to proceed) or to go back and fix to resubmit.

    From my hours of research I believe Qrules has a solution for this, I am currently trying to get our IT dept. (foreign) to take a look at the solution but who knows how long that will take.

    Hopefully I have given enough information to allow you to understand what I am trying to do. Any help anyone can offer would be absolutely awesome.

    Thanks Adam

     

     

  • 12-08-2014 09:50 AM In reply to

    Re: InfoPath repeating section rules based on button click outside of section

    Hi! I'm confused as to what the issue is? Is CountReviews not returning the number you expect? Is NumberOfReviews not getting set correctly? Or is it that the error message is incorrect?

    Hilary Stoupa

  • 12-08-2014 10:01 AM In reply to

    Re: InfoPath repeating section rules based on button click outside of section

    Wow qucik response, 

    I am having issues with the error message. When the button is clicked either nothing happens or it will populate the text box with only information from the first repeating section. In the attached file nothing happens when button is clicked…

    Thanks again

  • 12-08-2014 10:06 AM In reply to

    Re: InfoPath repeating section rules based on button click outside of section

    I took a closer look at your file - I can see what the issue is now.

    So - you want to block submit if for any of the AddCAPPlan groups the count of reviews is less than the number of reviews? But what would the error message display? A list of all the groups where that is the case?

    Hilary Stoupa

  • 12-08-2014 10:27 AM In reply to

    Re: InfoPath repeating section rules based on button click outside of section

    The block submit piece is not really the problem as I can just click the box to stop additional rules from running. I am looking for the list of all groups with errors.

     

    Example if in each section:

    Error: Number of reviews associated with CAP 1.1 is less than what is required. Based on the Date CAP started, CAP due date, and Frequency of review there should be a total of 10 though only 9 have been recorded.

     

    Example if on bottom of form (preferred):

    Error: Number of reviews associated with CAP 1.1 is less than what is required. Based on the Date CAP started, CAP due date, and Frequency of review there should be a total of 10 though only 9 have been recorded.

    Error: Number of reviews associated with CAP 1.3 is less than what is required. Based on the Date CAP started, CAP due date, and Frequency of review there should be a total of 5 though only 3 have been recorded.

    Error: Number of reviews associated with CAP 3.1 is less than what is required. Based on the Date CAP started, CAP due date, and Frequency of review there should be a total of 6 though only 5 have been recorded.

  • 12-08-2014 11:31 AM In reply to

    Re: InfoPath repeating section rules based on button click outside of section

    Here is what I would do -

    I would set the CAP Error field in each repeating group to the value you want the error to be, using a default value. Then I'd just put a repeating section at the bottom of the form that shows the error message if the count review is < the number. Then I would just disable the button if there are any errors. In the attached form I've kind of set up what I'm talking about - you can save it locally and then right click and select Design to see the changes.

    From the submit button an expression like this:
    my:group1/my:AddCAPPlan[my:CountReviews < my:NumberOfReviews]

    I think would let you know if there were any AddCAPPlan groups where the count of reviews was less than the number of reviews - but InfoPath doesn't have any built in way for you to set those individual error messages from outside the repeating group.

    Hilary Stoupa

  • 12-08-2014 11:55 AM In reply to

    Re: InfoPath repeating section rules based on button click outside of section

    You are absolutly awesome!!!

    As mentioned in original post does QRules have this functionality built in? Also while browsing Qdabra website I could not find a comprehensive list of functions available?

  • 12-08-2014 12:06 PM In reply to

    Re: InfoPath repeating section rules based on button click outside of section

    well - in qRules we could have used a command to go through and set all those nodes in the repeating group - even with qRules I would have taken this approach.

    The qRules command overview lists everything - download and install the free trial and then you can check out the command overview for more info on what all is included as well as try it out. :)

    Hilary Stoupa

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