[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 692
  • Last Modified:

Switching Views using User Roles and/or Open Behavior Rules

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
MikeXna
Asked:
MikeXna
  • 3
  • 3
1 Solution
 
clayfoxCommented:
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
 
MikeXnaAuthor Commented:
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
 
clayfoxCommented:
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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
MikeXnaAuthor Commented:
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
 
clayfoxCommented:
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
 
MikeXnaAuthor Commented:
I ended up creating AD Group to nest in appropriate users role.  That worked better for me. Thankgs again.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now