passing authenticated user creds to infopath

D

DeMarkus Webb

I’m trying to create a template that will automatically populate the user's
name (last and first name) when opening a form template on SharePoint.
Currently I’m using the Project Plan template and I want the text box Project
Owner to display the name of the individual currently logged on. Any help
you can provide would be greatly appreciated. Thanks in advance

DeMarkus
 
B

brianmiller77

you can use this in your managed code or call a webservice to do it for
you.

using System.DirectoryServices;
public string GetActiveDirectoryName()
{
DirectorySearcher ds = new DirectorySearcher("mailNickname=" +
System.Environment.UserName + ")");
SearchResult sr = ds.FindOne();
DirectoryEntry person = sr.GetDirectoryEntry();
return person.Name;
}

if you just want the username use System.Envirnment.UserName;

Brian Miller
 
D

DeMarkus Webb

Kaylan,

Thanks for responding. I have read three different ways to do this;
however, I am trying to stay away from editing the code. I am trying to use
the web service within SharePoint to pull the users data into infoPath.
This is the error I get when when typing in the location of the Web Service.

"The file is not a valid XML file.
The form contains XML that cannot be parsed:
A string literal was expected, but no opening quote character was found.

Line 11, Position 16
<Title ID=onetidTitle>Error</Title>"

I'm not sure where this error is taken place, if you have any knowlege or
input on this, i would greatly appreciate it.

Thanks
--dwebb
 
D

DeMarkus Webb

Brian,

Please inform with with a link or some directions on how to use the
webserive to populate a text box with the users name.
 
A

Atul Mathur

I am also facing the same problem. XML parsing error. Please help out.


The file is not a valid XML file.
The form contains XML that cannot be parsed:
A string literal was expected, but no opening quote character was found.

Line 12, Position 16
<Title ID=onetidTitle>Home - FinClosure</Title>
---------------^
 
S

S.Y.M. Wong-A-Ton

Going by what the error says, "onetidTitle" should probably be quoted as in:

<Title ID="onetidTitle">Home - FinClosure</Title>
 

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