Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form - InfoPath Dev
in

InfoPath Dev

Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

Last post 11-17-2008 02:49 AM by Anuma. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 11-16-2008 08:05 PM

    Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi,

    I've been working on a form for our company. I am having troubles in creating conditional formatting where in certain fields in the form should be hidden or disabled if the user logged in is not the who created the form.

    Example:

    User1 creates a form and then submits the form in to the SharePoint library. When User2 reads the form created by User1, User2 should be able to edit some fields in that form while the other fields can only be edited by User1 (who created the form) and an administrator.

    How am I supposed to do this?

    Thank you very much!

    jonahlazzz
  • 11-16-2008 09:08 PM In reply to

    Re: Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi,

     Can you follow the below steps  1.     Add User field to Data source and add the rule to that field user is blank then set field value to the “userName()”.2.     Add Conditional formatting to the fields by using the below steps3.     Select first dropdown to User and in second Dropdown select ‘is not equal to’ and select “Use a formaula’ and enter ‘userName()’ and click ‘ok’

    Select ‘Hide this control’ checkbox and click on ‘ok’.

    Thanks,
    Sandhya


  • 11-16-2008 09:27 PM In reply to

    • ravig
    • Top 500 Contributor
    • Joined on 06-21-2008
    • Posts 27

    Re: Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi,

    You can also design another view fo fields which are editable to all users.

    Check the whether the user opening the form is Creator or Administrator on load and switch to the new view if he is not a Creator or Administrator.

    You can do this by Tools --> Form Options --> Open and Save --> Rules (add rule hare) --> Add Action --> switch views.

    Ravi G
  • 11-16-2008 10:56 PM In reply to

    Re: Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi ravig,

    I did what you said me to do but it still doesn't work. One question though, how do you check wether who opens the form the creator or the Administrator? Thanks!

    jonahlazzz
  • 11-16-2008 11:02 PM In reply to

    Re: Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi sandhyapati,

     I did also what you said me to try but did not work. I need to know how can i compare the userName (when submitted becomes read-only) and the one who is currently logged-in so that I can hide the other control.

    Thanks!

    jonahlazzz
  • 11-16-2008 11:35 PM In reply to

    • ravig
    • Top 500 Contributor
    • Joined on 06-21-2008
    • Posts 27

    Re: Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi,

    You have to insert two fields to the form, one is creator and another one is Administrator.

    Then in Tools --> Form Options --> Open and Save --> Rules --> set condition

    use following conditions

    Creator field   'is not equal to'  Username() or

    Administrator  'is not equal to' Username()

     in set actions select Switch views and in views drop down select new view in which only few fields are editable

    Ravi G
  • 11-17-2008 01:00 AM In reply to

    Re: Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi Ravi,

    I know how to create the conditions but I do not know how to create fields and its properties you are describing...(can I create this using a textbox?how?)

    Thanks!

    jonahlazzz
  • 11-17-2008 02:49 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Certain fields in the form should be hidden or disabled if the user logged in is not the who created the form

    Hi,

     You can see the role name(From which role we have opened the form) in right side of the bottom pane.

    You can create the fields by using text boxes. But for dev purpose we can show those fields and for client purpose we cannot show those fields.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.