Expand my Community achievements bar.

SOLVED

Extracting the current user info

Avatar

Level 1

Hi,

I have a dynamic form created using LC Designer. Is it possible to extract the current user details who is viewing the form within the form itself?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Ankit,

If you create a .js file with the following code and put it in the JavaScripts folder under the installation directory of Reader (and/or Acrobat), this is C:\Program Files (x86)\Adobe\Reader 11.0\Reader\Javascripts on my machine and I called my file getIdentityLoginName.js, then any functions defined will become available as global function in your forms JavaScript and will also have access to secure objects like identity.  So the code is;

var getIdentityLoginName = app.trustedFunction(function () {

    app.beginPriv();

    return (identity.loginName);

    app.endPriv();

});

And can be called from a form like;

 

app.alert(getIdentityLoginName());

Regards

Bruce

View solution in original post

4 Replies

Avatar

Level 10

Hi,

I beleive you can only do this with a "folder level script",  this is a JavaScript file that is installed under the Reader/Acrobat installation.

Is it a possibilty to do this in your scenerio?

Regards

Bruce

Avatar

Level 1

Hi Bruce,

That would be a possibility, yes.

Could you please elaborate?

Thanks.

Ankit

Avatar

Correct answer by
Level 10

Hi Ankit,

If you create a .js file with the following code and put it in the JavaScripts folder under the installation directory of Reader (and/or Acrobat), this is C:\Program Files (x86)\Adobe\Reader 11.0\Reader\Javascripts on my machine and I called my file getIdentityLoginName.js, then any functions defined will become available as global function in your forms JavaScript and will also have access to secure objects like identity.  So the code is;

var getIdentityLoginName = app.trustedFunction(function () {

    app.beginPriv();

    return (identity.loginName);

    app.endPriv();

});

And can be called from a form like;

 

app.alert(getIdentityLoginName());

Regards

Bruce