Hello everyone, this forum has always been so helpful, I'm hoping you guys can help me solve one more.
Utilizing infopath 2003 (yes, large corporations tend to lag behind on upgrades) I have inserted a get login username code based off of a prior posting which works great.
var wshShell = new ActiveXObject("Wscript.Shell");
var wshEnv = wshShell.Environment("Process");
var username = wshEnv.Item("UserName");
XDocument.DOM.selectSingleNode("dfs:myFields/my:Relayview").text= username;
I've relayed this value to personal fields that build logic off of one another to derive the group and dept. ID as well.
The form itself is a time tracking form, where users log their projects. Its great that it can self identify who the user is, but here's the issue.
As soon as the "new record" button is clicked, Vuwala, everything is wiped out and all my concatenated fields that rely on the username variable are reduced to junk. Using a refresh button doesn't work bc it only refreshes the data connection. The only option I can see at this point is that I have the form close and re-open, but that will look terrible.
does anyone know of any work arounds? It seems I just need to refresh the scripts and webservice for the username isn't an option either b/c I have no idea what the correct adpx addresses are.
Thanks in advance!!