Home > Infopath, SharePoint > Getting username() in Infopath 2003 using JScript

Getting username() in Infopath 2003 using JScript

In Infopath 2007 version you have username() function to get the user id (lan id) of the user, however Infopath 2003 you use java script to get the user name.

function GetUserID()
{
var objNetwork = new ActiveXObject("WScript.network");
var uid = objNetwork.UserName;
return uid;
}
Advertisements
  1. Anonymous
    September 16, 2011 at 2:02 PM

    I’m trying to use the above code to get username infopath 2003. However the code generates error message. I put it in the “on_load” event.Can you please let me know?

    Thanks

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: