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
}