Solved

Switching Views using User Roles and/or Open Behavior Rules

Posted on 2010-09-20
6
668 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 33724479
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
ID: 33729517
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
ID: 33731296
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:MikeXna
ID: 33738284
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
ID: 33759518
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
ID: 34084123
I ended up creating AD Group to nest in appropriate users role.  That worked better for me. Thankgs again.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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