Solved

Switching Views using User Roles and/or Open Behavior Rules

Posted on 2010-09-20
6
660 Views
Last Modified: 2012-05-10
Hi,

I want to switch views if uername = a field on my InfoPath 2007 form.
Do I need to configure both User Roles and Open behvior Rules or just Conditional Open Behavior Rules?

I tried configuring my User Roles using the "User Name From the Form" option.
I have 5 different views so I created 5 differnt roles and 5 different text fields on my form, each containing a differnt managers user name.  These are populated from my filtererd data connection that successfully fills in the text field with the desired username accordingly, and 5 different open behavior rules.

Here is an example of an open behaviour rule that is currently not working:
Apply the Role when the Condition is True:
User Current Role is Equal to "Manager1 User Role"
Switch to View: Manager 1's View

 It sounds really straight forward but I must be missing something simple as it is not working.
Do you know what I may be doing wrong or am forgetting?
I don't fully understand when I should check the box "Stop Processing Rules when this rule finishes"
I have not been checking the box as I don't fully understand its purpose.  
Maybe I don't even need roles as it looks like i can set a condition so username = fileld on the form.
If I don't use User Roles, I dont think I can take advantage of the Initiator feature that allows the manager to submit a create a new form before the view gets switched on them...?

What is best way to switch a view when getting usernames from fileds on the form?
I have a default view i want to use but I am still trying to grasp the concept of the initiator and default role and the order in which they should be listed.

I appreciate your advice!  Thanks!
0
Comment
Question by:MikeXna
  • 3
  • 3
6 Comments
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
Comment Utility
User roles are something different. Just use the Username function to get the current user's AD user name.

I beleive I know what you are doing. As a user completes a form you save the amanger and others who need to review or open the form, then as the form opens, you match the names and give them the specific experience.

Open rules is what you want and set your conditions username() = ManagerField or whatever for your workflow.

The Stop running rules check box is a kick out so that if that condition succeeds then do not keep going through the rest of the rules. Sometimes helpful other times it is not.
0
 

Author Comment

by:MikeXna
Comment Utility
Thanks for your comment,  but I still need some help if you can.  I learned something new today.  I will try to explain.
By they way, you read my mind.  That is exactly what I am looking to do. I need my managers to be sent to their own view to approve the form and write comments, etc.

Today I deleted all of my rules and roles and started over.
I noticed that my problem seems to be related to how the mangers username is set as the default value in the corresponding manger form field.

Although I successfully used the wizard to set the default value by filtering my data connection to my employee directory list to enter "JSmith" in the field.  I know it works as I see "Jsmith in the field when I preview the form.  However InfoPath does not like for some reason and does not change the view when i set the condition to When Manager1field is equal to username.

But

When if I set the default value to the manager1 field manually to Jsmith and use the same condition, the view switches perfectly.

Any idea why InfoPath does not like my value when it is a result from a dataconnection filter?
I need to this work as I plan to create many many forms and do not want to edit each form when ever a new manger gets hired.

Thanks again for any suggestions you have!!!
0
 
LVL 28

Expert Comment

by:clayfox
Comment Utility
It may be the case, when you compare text it needs to be exact.  The other thing is there can be hidden spaces on one side or the other.

normalize function will remove space.

translate function can set them all to caps.

www.infopathdev.com can be a good resource too.

You are doing the right thing and starting over and keeping it simple and testing it step by step.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:MikeXna
Comment Utility
Thanks.  I will try that.  I need to find the sytax to the normalize and trasnlate functions.
I tried using "contains" in the condition like so, but it did not work either.

Apply the Role when the Condition is True:
Manager1field contains userName()
Switch to View: Manager 1's View

That should have resolved any extra spaces or case sensitivity issues  too right?
It's not looking good for me. =(

If you think of anything else please let me know.
0
 
LVL 28

Expert Comment

by:clayfox
Comment Utility
You would probably want normalize(Managerfield1) contains Username().  You may have to switch to an expression to put the normalize in.  Or you can have a rule triggered that sets Managerfield1 to normalize(managerfield1).

translate(managerfield1,"qwertyuiopasdfghjklzxcvbnm","QWERTYUIOPASDFGHJKLZXCVBNM") this will make it all caps.
0
 

Author Closing Comment

by:MikeXna
Comment Utility
I ended up creating AD Group to nest in appropriate users role.  That worked better for me. Thankgs again.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now