Retrieve username, firstname and lastname - InfoPath Dev
in

InfoPath Dev

Retrieve username, firstname and lastname

Last post 04-01-2010 01:01 PM by cguruc. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-17-2010 09:25 AM

    • cguruc
    • Not Ranked
    • Joined on 02-28-2010
    • Posts 7

    Retrieve username, firstname and lastname

    Hello everyone,

    I have been trying to populate the username, firstname and lastname using jscript.

    After numerous tries, i was able to get the username populated in a form field. However, I have 2 issues now that I need help with.

    Issue 1: When the form is previwed from a design mode, the username populated with no issue. However, after publishing the form and opening it from a shared location, the username stays blank. (please look at the code below).

    Issue 2: Can anyone help me with populating firstname and lastname?

    function XDocument::OnLoad(eventObj)

    { var wshShell = new ActiveXObject("WScript.Shell");

    var username = wshShell.ExpandEnvironmentStrings("%username%");

    XDocument.DOM.selectSingleNode("/dfs:myFields/my:employee").text=wshEnv("UserName")=username

    }

     

    Filed under: ,
  • 03-17-2010 09:34 PM In reply to

    Re: Retrieve username, firstname and lastname

    Where are you getting the identity information?

    I can't help with the code, but I can tell you that Qdabra has an Active Directory Web Service tool that will retrieve all that info for you and do so very easily.

  • 04-01-2010 12:56 PM In reply to

    • cguruc
    • Not Ranked
    • Joined on 02-28-2010
    • Posts 7

    Re: Retrieve username, firstname and lastname

    Thanks for your reply. i will take a look at Qdabra.

     

  • 04-01-2010 01:01 PM In reply to

    • cguruc
    • Not Ranked
    • Joined on 02-28-2010
    • Posts 7

    Re: Retrieve username, firstname and lastname

    Where are you getting the identity information? - based on location machine/username

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.