Can one checkbox in mutliselect box be disabled by rule? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Can one checkbox in mutliselect box be disabled by rule?

Last post 04-19-2018 10:20 AM by Lou Gonzalez. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 04-13-2018 07:14 AM

    Can one checkbox in mutliselect box be disabled by rule?

    Hello!

    I am using InfoPath 2013 and have a form which contains a Class dropdown box and a multiselect box with department information in it. We would like to add the following functionality.

    When a user selects a class that starts with "CADLP Cadence Scheduler " then disable just the "No Scheduling Security Required" checkbox in the mutliselect box. We would like to force them to select a department. We do not want to give them the option of choosing "No Scheduling Security Required". All other checkboxes should be active. We have about 5 other classes that this logic would apply to.

    Is it possible to disable a particular checkbox in a mutliselect box based on values in a dropdown box?

    Thanks in advance for your assistance! 


  • 04-13-2018 07:47 AM In reply to

    Re: Can one checkbox in mutliselect box be disabled by rule?

    You can't disable it, but you could add a filter. If the values in your multi-select are hard coded (i.e., not a lookup like your Class drop down) - there probably won't be a way to do this. So, you might want to put those values in their own list, then change the column type to a lookup so you can filter out "no scheduling security required" if needed. However, there are a number of things that are tricky about multi-selects, and I'm concerned that a user could select that option before the class was selected, which would leave it selected once they set the class field. Or they could toggle the class field and it would still be selected.
    Hilary Stoupa

  • 04-13-2018 08:32 AM In reply to

    Re: Can one checkbox in mutliselect box be disabled by rule?

    Yes unfortunately the departments are hard coded. If I put them in their own list and used that list as the source for my departments multiselect box, how do I filter that out if they chose "CADLP Cadence Scheduler " class?

  • 04-13-2018 08:44 AM In reply to

    Re: Can one checkbox in mutliselect box be disabled by rule?

    You add a filter to the data source for the multiselect - again, it will be slightly complicated, because the Class field stores the ID of its lookup - effectively, you need to filter for the items that don't equal the value you don't want if the Class display starts with CADLP. However, as I've mentioned - this can get kinda icky because of how multi-selects work. I'll try to put together a simple sample for you but it will probably be the end of the day before I have time.
    Hilary Stoupa

  • 04-13-2018 02:23 PM In reply to

    Re: Can one checkbox in mutliselect box be disabled by rule?

    Sample attached.
    Hilary Stoupa

  • 04-17-2018 01:42 PM In reply to

    Re: Can one checkbox in mutliselect box be disabled by rule?

    Thanks so much for the sample! I didn't immediately see how you accomplished the filtering but I will study it tomorrow.

    For reasons I won't go into, I've decided to take a different approach now. Basically I'm hiding the entire Epic Departments section unless they select a class that starts with "CADLP Cadence Scheduler ". That meets my end users needs. I'll remove the "No Scheduling Security Required" option.

    However I am having trouble making the multi-select box required. I am using the same rule logic as whats being used on the rest of the conditionally required fields but for the multi-select box, its not working. Is this another caveat of multi-select boxes?

  • 04-18-2018 07:34 AM In reply to

    Seeing a little more weirdness. Using the same rule logic with different values, the Epic Departments section is not unhidden when a "CADLP" value is chosen from the Class dropdown. Oddly it worked 2 days ago. Now I open it and it does NOT work any longer. Any idea why that would be? I have attached my template.

    I use the exact same Xpath syntax used to hide/unhide a different section on the same form but it doesn't work:

    This Rule works:

    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "Reporting 100"))

    This Rule doesn't work:

    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Template Builder"))    

     

    The only difference I see is the Class Name. And its checking the same Class dropdowns. I've double checked and there are Class entries that start with CADLP Cadence Template Builder so not sure why it doesn't work but the Reporting 100 does.

    What am I missing? :) 

  • 04-18-2018 08:14 AM In reply to

    Re: Can one checkbox in mutliselect box be disabled by rule?

     So - this section is showing or hiding based on Class selection? Not Additional Class selection?

    Hilary Stoupa

  • 04-18-2018 08:21 AM In reply to

    Its looking at either Class or Additional Classes dropdown for those values and should UNHIDE the section containing Epic Departments.

    And oddly enough, when I removed the rules that didn't work and added the same exact ones back in, they work! I don't get it. LOL

    EDIT:

    InfoPath will only let me add 5 conditions to a rule. So I had to create an additional rule for the section to accommodate additional class criteria. When I add the 2nd rule, things stop working. Is there a way around this?

    Rule attached to section holding Epic Departments

    Rule 1 - "Show Epic Departments when Scheduler CADLP Template Builder or CADLP Front Desk class is selected"

    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Template Builder"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Template Builder"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Front Desk"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Front Desk"))

    Rule 2 - "Show Epic Departments when Scheduler CADLP Referral Coord or CADLP Scheduler class is selected"

    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Referral Coord"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Referral Coord"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Scheduler"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Scheduler"))

     

    2nd EDIT:

    I found a thread where you mentioned stringing conditions together with AND or OR.

    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Template Builder")) and not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Template Builder"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Front Desk")) and not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Front Desk"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Referral Coord")) and not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Referral Coord"))
    not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Class], "CADLP Cadence Scheduler")) and not(starts-with(xdXDocument:GetDOM("ClassInfoForEnrollementForm")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Class[../d:ID = current()/my:Additional_x0020_Classes], "CADLP Cadence Scheduler"))

    There is only one rule now. I modified the rule to include everything above and things are still not working as expected.

    When selecting "CADLP Cadence Template Builder" from Class or Additional classes, the section does not unhide. :(
    When selecting "CADLP Cadence Front Desk" from Class or Additional classes, the section does not unhide. :(
    When selecting "CADLP Cadence Referral Coord" from Class or Additional classes, the section does unhide. :)
    When selecting "CADLP Cadence Scheduler" from Class or Additional classes, the section does unhide. :)

  • 04-19-2018 10:20 AM In reply to

    Hi Hilary!

    Thanks again for all your help. Its been an invaluable learning lesson for me.

    So I removed all of the above Xpath code from the section condition. I then re-added them. Now it works. I have no idea why. :)

    I am just about done now with the changes my team needs. I just need to make the multi-select box required when one of the classes above is selected. However I found a thread on here that mentions validation isn't available for MS boxes. So I created a rule on the submit button that disables it when Epic Department MS box is empty. However that MS box is conditional and only appears when a user selects a CADLP class.

    How do I enable the submit button for everyone who does NOT select one of the classes in the Class dropdown? And disable the Submit button when they do select one of the CADLP Classes from the Class drop down box; and once they select an Epic Department from the MS Box, THEN enable the submit button? Hope that makes sense. I've attached my working template.

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