User roles - need help please

T

TDM

Hello all,

First, I am new to Infopath so be gentle.

I have a Forms library in SharePoint. I want to create a form
that displays different controls on the form base on the users
NT Account name.

I first set up the Infopath user roles in Tools/User Roles. I added roles
and assigned "User Names" to these roles. When you click the
user name button, it brings up XP's User Manager, so I assumed
that since you can select and validate NT Account names, that
they were valid choices.

Then I set up the controls to display based on a user role as
such, I select the control properties, select the Display tab,
select Conditional Formatting, add a conditon, and set the condition to :

Users Current role is equal to UserRoleName

I then apply the formatting, in my case, "Hide this control".

I then publish the form, go to sharepoint, open a new document
from the forms library, and no matter who I am logged in as, the user
role in the lower right corner of the infopath form is ALWAYS the user
role that is set to default. I am not able to change the user role, or for
that matter, get Infopath to recognize/define the user role the way I
think it is supposed to work, based on NT account names per the
way I set up the user role.

So, my question is, how does one get Infopath to hide/display
controls based on the users NT account name ? I must be going
about it the wrong way, or am totally ignorant as to what user roles
really are in Infopath.

Any and all help is greatly appreciated, and thanks in advance.


TDM
 
S

Santhosh (GGK Tech)

Hi,

Make sure that 'set as initiator' check box is unchecked for your default
role. If it is checked then form will be opened with this user role
regardless of the user.
 
T

TDM

Santhosh (GGK Tech) said:
Hi,

Make sure that 'set as initiator' check box is unchecked for your default
role. If it is checked then form will be opened with this user role
regardless of the user.

Already tried that, any other ideas ?

Thanks !

TDM
 
T

TDM

Sandhya said:
Hi,

Can you go through the below links.I hope it might help you.
http://office.microsoft.com/en-us/infopath/CH100598281033.aspx
http://msdn.microsoft.com/en-us/library/bb251015.aspx

--
Thanks,
Sandhya



:

One other thought I had, we don't have the Enterprise version of SharePoint,
would that make a difference ? I notice that "Infopath Services" is only a feature
of the Enterprise version, so all uses are required to have InfoPath installed to
open the form. Not sure this is really relavant, as I dont think it should be, but
you never know.

TDM
 
T

TDM

TDM said:
Hello all,

First, I am new to Infopath so be gentle.

I have a Forms library in SharePoint. I want to create a form
that displays different controls on the form base on the users
NT Account name.

I first set up the Infopath user roles in Tools/User Roles. I added roles
and assigned "User Names" to these roles. When you click the
user name button, it brings up XP's User Manager, so I assumed
that since you can select and validate NT Account names, that
they were valid choices.

Then I set up the controls to display based on a user role as
such, I select the control properties, select the Display tab,
select Conditional Formatting, add a conditon, and set the condition to :

Users Current role is equal to UserRoleName

I then apply the formatting, in my case, "Hide this control".

I then publish the form, go to sharepoint, open a new document
from the forms library, and no matter who I am logged in as, the user
role in the lower right corner of the infopath form is ALWAYS the user
role that is set to default. I am not able to change the user role, or for
that matter, get Infopath to recognize/define the user role the way I
think it is supposed to work, based on NT account names per the
way I set up the user role.

So, my question is, how does one get Infopath to hide/display
controls based on the users NT account name ? I must be going
about it the wrong way, or am totally ignorant as to what user roles
really are in Infopath.

Any and all help is greatly appreciated, and thanks in advance.


TDM


In case anyone cares, it turned out to be a Domain authentication issue. I
failed to mention that users accessing SharePoint were on a different
domain than the SharePoint server. I had been setting the Infopath
User role accounts based on the SharePoint login, but I was wrong.
It looks like InfoPath authenticates on the user system and not with
SharePoint, which when you think about it, makes sense since
InfoPath is running on the user system. I was stupid in thinking
the authentication was with SharePoint.

TDM
 
S

Shiva (GGK Tech)

Hello,

In onLoad code, we will get user role using the below statement,
string roleName = XDocument.Role;

You have to set this value to one field and depend on this value you have to
add the conditional formatting for those fields.

Condition:

roleName is not equal to ‘RoleName’
 
C

Charlie Weis

TDM,

I know it's been nearly 3 years since you posted this problem, but I'm wondering if you still work in the InfoPath world. I'm having very similar problems to your post and haven't found a workable solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top