Switch Views based on current user login - InfoPath Dev
in

InfoPath Dev

Switch Views based on current user login

Last post 01-29-2009 12:55 AM by jeeva. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-28-2009 10:46 PM

    • jeeva
    • Top 150 Contributor
      Male
    • Joined on 07-17-2008
    • Bangalore
    • Posts 79

    Switch Views based on current user login

    Hi I created browser enabled Info path form. It contains two views one for Employee and another one for HR. I have 5 HR persons, while HR persons open a form it should be open HR view . In HR View i have button for switch Employee view also. when employees opens form it should be Employee view only. In employee view also have one button for HR view(this button only enable when HR as current user otherwise it should be hidden). How can i achieve this in my info path form. Advance thanks.... Regards Jeeva
    Filed under:
  • 01-28-2009 11:27 PM In reply to

    • bogdantc
    • Not Ranked
      Male
    • Joined on 05-28-2008
    • Bucharest
    • Posts 25

    Re: Switch Views based on current user login

     The easiest way is to put a set of rules when your form is opening.

     

     

    Able was I ere I saw Elba
  • 01-28-2009 11:53 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Switch Views based on current user login

    Hello,

    You have to add the code to check current user belongs to which group. Based on that you have to switch view either employees view or HR view.

    You have to add the conditional formatting for button in employees view.

  • 01-29-2009 12:06 AM In reply to

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

    Re: Switch Views based on current user login

    Hi, Create one xml file with HR users list. For example <HRManagers>          <HR>anuma</HR>          <HR>Shive</HR></HRManagers> And add this xml file as xml data connection to the form.Add one hidden field “CurrentUser” to the schema and set default value as “userName()” function.Add one open Rule to the form.
    1. Go to Toolsà Form Options.
    2. Switch to “Open and Save” tab.
    3. Select Rules and Click on Add button.
    4. Click on set Condition.
    5. Add condition as “CurrentUser” is equal to “HR”
    6. Click on ok.
    7. Click on Add Action button.
    8. Select “Switch Views”.
    9. Select “HR view” in the view dropdown.
    10. Click on ok.
    If your default view is HRview. Change above Condition to  “CurrentUser” is not equal to “HR” and change Switch View to "Employee view ".
    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-29-2009 12:08 AM In reply to

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

    Re: Switch Views based on current user login

    And also add following conditional formatting to the "Switch to HR View" button.

    “CurrentUser” is not equal to “HR”  then hid ethis button.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-29-2009 12:55 AM In reply to

    • jeeva
    • Top 150 Contributor
      Male
    • Joined on 07-17-2008
    • Bangalore
    • Posts 79

    Re: Switch Views based on current user login

    Thank you very much anuma. Now am able to switch the views exactly.....
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.