Hi, Here we are working with Infopath, sharepoint and Biztalk. All the 3 are
at different locations. The problem iam facing is iam not able to get the
username from the infoptah.
The scenario is something like this. The user will loging to the sharepoint
portal, then he will go to one formlibrary and will click on Fillout form.
Then the Infopath form will open, that time based on the user role i need to
hide/display some of the sections in Infopath. But iam not able to get the
userid from the infopath when it is in network.
Any help regarding this?
Thanks in advance.
Alex [MSFT] - 26 May 2005 21:14 GMT
The simplest way to get the login ID of the person currently filling out
the form is to write a WhoAmI web service, and use it as a secondary
data source in your form:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsr
v/html/httpsecurity.asp
Good luck,
Alex @ Microsoft
-----Original Message-----
From: Venkatesh [mailto:Venkatesh@discussions.microsoft.com]
Posted At: Tuesday, May 24, 2005 10:52 PM
Posted To: microsoft.public.infopath
Conversation: How to get the Windows Login UserID from Infopath
Subject: How to get the Windows Login UserID from Infopath
Hi, Here we are working with Infopath, sharepoint and Biztalk. All the 3
are
at different locations. The problem iam facing is iam not able to get
the
username from the infoptah.
The scenario is something like this. The user will loging to the
sharepoint
portal, then he will go to one formlibrary and will click on Fillout
form.
Then the Infopath form will open, that time based on the user role i
need to
hide/display some of the sections in Infopath. But iam not able to get
the
userid from the infopath when it is in network.
Any help regarding this?
Thanks in advance.
Jim - 31 May 2005 12:52 GMT
Venketesh, did you solve the problem??? If so please share the solution. I
still could not solve the problem
Jamesy - 24 Aug 2005 09:09 GMT
wow! I may finally be able to offer something back!
Assuming that you have access to SQL Server .....
1) Create dummy database with public access
2) Create a new data connection to the database using windows authentication
and edit the SQL to ;
select system_user
(You'll be warned that no tree-view can be created, but just OK that)
3) Create a text-field (hidden) and add a rule that if blank set value to
the C* field of the connection that you have just created.
Viola, when the form loads, the field is populated with the users
domain\userid
Jamesy
> Venketesh, did you solve the problem??? If so please share the solution. I
> still could not solve the problem
Sandeep - 09 Nov 2005 20:09 GMT
C# code:
public void OnLoad(DocReturnEvent e)
{
setNodeValue("Your Xml path", System.Environment.UserName);
}