Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / February 2006

Tip: Looking for answers? Try searching our database.

Newbie question. Getting curent user login ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
grisha0@gmail.com - 31 Jan 2006 12:39 GMT
Hi,
i've got a problem,
i've designed a very complex form (3 fields ;))

what i want to get ?

I want to create an automatic procedure/event(onload)/or smth (for
example) which will check who is the currently logged user and return
hers/his login to specified field.

i've searched the google and msdn ... no luck to solve my problem

thanks for any responce
Grisha
Kalyan Reddy - 31 Jan 2006 14:35 GMT
Hi Grisha,

Write this Code in C#    
System.Environment.UserName
to get the logged in userin to any field

Signature

Kalyan Reddy
Visit www.autonomysystems.com

> Hi,
> i've got a problem,
[quoted text clipped - 10 lines]
> thanks for any responce
> Grisha
grisha0@gmail.com - 31 Jan 2006 14:58 GMT
thanks for you reply but as i can see (i do remind that im new to the
infopath) only scripting method (like Tools -> script -> On load
event).... but is it normal c# or VB ?

or do i have to create an full assebly (like dll) in VS.net ?
Kalyan Reddy - 31 Jan 2006 15:51 GMT
Yes You can use normal c# and no need of creating Assemblies, dll etc.

thisXDocument.DOM.selectSingleNode(...<You need to write the XML XPAth
here>...).text = System.Environment.UserName;

also go through this link below for better understandin
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=263&SearchTerms=Current,user

Signature

Kalyan Reddy
Visit www.autonomysystems.com

> thanks for you reply but as i can see (i do remind that im new to the
> infopath) only scripting method (like Tools -> script -> On load
> event).... but is it normal c# or VB ?
>
> or do i have to create an full assebly (like dll) in VS.net ?
grisha0@gmail.com - 01 Feb 2006 15:17 GMT
thx big help but i've got an error...

my script.js is:
XDocument.DOM.setProperty("SelectionNamespaces",
'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-01T14:45:05"');

function XDocument::OnLoad(eventObj)
{

XDocument.DOM.selectSingleNode("my:mojePola/my:user").text =
System.Environment.UserName;

}

error is:
Error line 7
"System" is undefined

do i miss some directive like c# using ??
Sandeep - 02 Feb 2006 07:28 GMT
Hi grisha

You need to build an ADService webservice and use that to get the User name.
There is another way to get the UserName using an ActiveX component, but
that needs your solution to be a FullTust solution.

There is an ADService available at this site, that you can use to get user
Details from ADService.

Check out this links.

http://www.infopathdev.com/webstore/detail.aspx?itemid=18
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1524&SearchTerms=System.Env
ironment.UserName


Signature

Sandeep
www.autonomysystems.com

> thx big help but i've got an error...
>
[quoted text clipped - 15 lines]
>
> do i miss some directive like c# using ??
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.