user roles and conditional formatting - InfoPath Dev
in

InfoPath Dev

user roles and conditional formatting

Last post 07-09-2009 01:10 PM by warrtalon. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-09-2009 04:41 AM

    user roles and conditional formatting

    Hello all,

     I am facing a major problem using user roles in conditional formating for controls. Here is my problem:

    I have a number of controls in a form, which have to be locked after the form is submitted to sharepoint. According to a selection in one of the controls, the form can be categorized as Large or Small. My purpose is to create a conditional formatting for the controls such that:

    • if Small - both users with role "Local Facilitator" & "Global Facilitator" to have access to the locked fields. If done saparetely the formatting looks like this: if user's current role is not equal to  "Local Facilitator" and user's current role is not equal to  "Global Facilitator" and control's value = Small; then apply disable/read only.
    •  if Large, only the user with the role "Global Facilitator" should have the right to edit the locked fields: the conditional formatting looks like this user's current role is not equal to  "Global Facilitator" and control's value = Large; then apply disable/read only.

    So both of these conditions work fine wneh they are applied separately. But how can I apply both of them? Using my current knowledge and logic, I cannot find a proper solution. Can anyone provide me with some ideas..

     

    Thank you in advance,

    Svetoslav

  • 07-09-2009 09:05 AM In reply to

    Re: user roles and conditional formatting

    You're missing the condition to check for large or small.  Also, your small condition should not be and - it should be OR.  If you use AND, then users have to be in BOTH of those groups in order to edit the fields.

     For small, it should be like this:

    • If user's current role is not equal to "Local Facilitator" AND
    • FormSize = Small OR
    • If user's current role is not equal to "Global Facilitator" AND
    • FormSize = Small
    • Disable this control

    For Large, it should be:

    • If user's current role is not equal to "Global Facilitator"
    • Then Disable control

    You don't care if it's large or small for the large condition - you only care that it's a Global Facilitator, since they can always edit unless you have some other setting besides large and small.

    If you have a bunch of fields, then instead of adding this to each one, you can create a section with these conditions that HIDES the section, or if you want people to see the fields without being able to edit, then create separate views - one for Local Facilitators and one for Global Facilitators.  You switch to the corresponding view based off the current user's affiliation, and that view will have the fields that person needs to be able to edit with others being all read-only without conditions.  You would also turn off the ability to manually switch views.

      • 07-09-2009 12:28 PM In reply to

        Re: user roles and conditional formatting

         Hello  warrtalon,

         

        thank you very much for your reply. It seems I really got wrong in the logic... But still,if I apply the conditions separately, one after another for a given control wouldn't they eliminate each other. I mean that if the 1st condition for a Small leads to desable, than if the second enables it - which one will be valid.. I am sure I have to test it as soon as possible to see the result. 

        On the other hand your idea about the views and read only view is just brilliant. I havent thought of it at all... 

        Best regards, 

        Svetoslav 

      • 07-09-2009 01:10 PM In reply to

        Re: user roles and conditional formatting

        I may not have typed the logic exactly right, but the concept is sound.  You can definitely write the logic to meet your needs, but it's just a matter of getting it exactly how you want it to work in all scenarios.

        The View method may be your best bet, because it will save you a lot of time with building logic statements all over the place.

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