How do you capture "current operator" (Windows Account preferably orname) dynamcally

A

andy.novak

We have a project request form developed in InfoPath which uses the
concept of a Requestor and Assessor. Depending upon the role of the
current user, they will be presented with one of two different views.

What we are trying to do is capture the identity of the current
operator (Windows Account preferably) each and every time the form is
opened AFTER its filled in the first time. This way we can compare
the current user to the Requestor field and the Assessor field to
determine which view they should be able to see.

We are capturing this information from Active Directory and placing it
in a field on the form. However, it will not overlay that value with
the identify of the operator after the form has been written to once.
The information remains the same after the form is filled out
initially - no matter who opens it subsequently. We want the Windows
account value to change each time a user opens the form.

Please help.

Thanks,
Andy Novak
University of North Texas
 
B

Ben Walters

Hey Andy,
There are a couple of ways to do this,
a: You can use the UserName() xpath function from within InfoPath this will
return the username of the current user
To access this function open the properties for a field, set the default
value, and click on the FX button
Click the Insert function button
select the "userName()" function and click ok
close all dialogs
b: you can use the code this.Application.User.UserName to return the
username of the current user

Hope this helps
Cheers
Ben Walters
 
L

Lisa

I use the username() function in the open behavior rules (Tools, form
options, Open and Save) and write to a field CurrentUser each time the form
is opened. Putting the function in the default will not update each time.
 

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