Re: SPS and InfoPath

From: Stefan Nagel (sn_at_compus.de)
Date: 03/04/04


Date: Thu, 4 Mar 2004 08:55:38 +0100

hello Todd!

the first advice works great, but this webservice is too difficult for me!
do you have something shorter or a script, which i can use in my infopath
form that does the same as the webservice?

regards
Stephen

"Todd M. Taylor" <flygtiguy@NOSPAMhotmail.com> schrieb im Newsbeitrag
news:exhFkeHAEHA.3220@TK2MSFTNGP10.phx.gbl...
> Stephan;
>
> If you would like to simply return the user's Active Directory account
name
> (domain\username), you can use this script:
>
> *******************************
> function XDocument::OnLoad(eventObj)
> {
> //Create a WScript.Network object, which provides access to the user data
> var objNetwork = new ActiveXObject("WScript.network");
>
> //Retrieve the UserName and write it into the my:UserName field
> XDocument.DOM.selectSingleNode("/my:myFields/my:UserName").text
> = objNetwork.UserName;
>
> //Retrieve the UserDomain and write it into the my:UserDomain field
> XDocument.DOM.selectSingleNode("/my:myFields/my:UserDomain").text
> = objNetwork.UserDomain;
>
> //Retrieve the ComputerName and write it into the my:ComputerName field
> XDocument.DOM.selectSingleNode("/my:myFields/my:ComputerName").text
> = objNetwork.ComputerName;
> }
> *******************************
>
> However, if you want more, like the user's actual name, you can use a web
> service to access the SharePoint database. I found a free web service
> called "GetMyProfile" to retrieve user info from the SharePoint database
to
> populate my InfoPath form... and it works great!
>
> You can download the web service and the rest of the project tutorial
here:
>
http://msdn.microsoft.com/office/understanding/infopath/toolsandcode/default.aspx?pull=/library/en-us/odc_sp2003_ta/html/sharepoint_integrating_sps_and_infopath.asp
>
> Sincerely,
> Todd M. Taylor
>
>