Switch Views based on current user login - InfoPath Dev Sign in | Join | Help in Views InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Views » Switch Views based on current user login 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: Oldest to newest Newest to oldest Previous Next 01-28-2009 10:46 PM jeeva Joined on 07-17-2008 Bangalore Posts 79 Switch Views based on current user login Reply Contact 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: View 01-28-2009 11:27 PM In reply to bogdantc Joined on 05-28-2008 Bucharest Posts 25 Re: Switch Views based on current user login Mark as Not AnswerMark as Answer... Reply Contact 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 Joined on 04-15-2005 India Posts 694 Re: Switch Views based on current user login Mark as Not AnswerMark as Answer... Reply Contact 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. Shiva / http://www.ggktech.com 01-29-2009 12:06 AM In reply to Anuma Joined on 07-20-2005 India Posts 525 Re: Switch Views based on current user login Mark as Not AnswerMark as Answer... Reply Contact 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. Go to Toolsà Form Options. Switch to “Open and Save” tab. Select Rules and Click on Add button. Click on set Condition. Add condition as “CurrentUser” is equal to “HR” Click on ok. Click on Add Action button. Select “Switch Views”. Select “HR view” in the view dropdown. 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 Joined on 07-20-2005 India Posts 525 Re: Switch Views based on current user login Mark as Not AnswerMark as Answer... Reply Contact 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 Joined on 07-17-2008 Bangalore Posts 79 Re: Switch Views based on current user login Mark as Not AnswerMark as Answer... Reply Contact 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.
The easiest way is to put a set of rules when your form is opening.
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.
And also add following conditional formatting to the "Switch to HR View" button.
“CurrentUser” is not equal to “HR” then hid ethis button.