How do I disable a control based on Active Directory user name?

A

A.M

Hi,



How can I make a control enable/disable based on an active directory user
name?



I have 20 rows in a repeating table and each row must be enabled only to AD
user that is mentioned within each row data. Is it possible?



Any help would be appreciated.

Alan
 
S

Scott L. Heim [MSFT]

Hi,

Probably the best option here is going to be to use a "Filter" to only show
those rows where the name of the user in the row matches the user returned
from AD.

- Right-click on your Repeating Table and choose Properties
- Select the Display Tab
- Click the Filter Data button
- Click Add
- In the first drop-down list select the field from your Repeating Table
that contains the user name
- In the second drop-down select "is equal to"
- In the third drop-down, select the field on your form that contains the
result of your AD validation.

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

A.M

Thank you for help.

How do I know what is the AD user name of the current form user?

Alan
 
S

Scott L. Heim [MSFT]

Hi Alan,

You will have to write custom code to get the AD user name. In many cases,
you can use a "WhoAmI" web service to accomplish what you need. The
following InfoPath BLOG has some sample C#.NET code:

http://blogs.msdn.com/davfries/archive/2004/06/29/169043.aspx

If you are just using JScript or VBScript you can look at using Active
Directory Service Interface (ADSI) to query your AD for user validation:

http://www.microsoft.com/windows2000/techinfo/howitworks/activedirectory/ads
ilinks.asp

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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