Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / August 2005

Tip: Looking for answers? Try searching our database.

Username in InfoPath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jerusik - 20 Jun 2005 15:38 GMT
when I create an InfoPath 2003form going through Visual Studio, I can put the
following code in the OnLoad event handler and access the  username without
any problems. (Formatting changed to conserve space)

IXMLDOMNode nodeEmployee =
thisXDocument.DOM.selectSingleNode("my:myFields/my:employee");
if(nodeEmployee != null)
    { if(nodeEmployee.text == "")
    {  nodeEmployee.text = System.Environment.UserName;
    }  }

Repeating the process in a from created by opening InfoPath 2003 directcly,
I get the following error when I preview the form:

Expected ';'
File:script.js
Line:27
            IXMLDOMNode nodeEmployee =

Does anyone have any ideas? I have tried everything but the right one. Thanks.
Scott L. Heim [MSFT] - 20 Jun 2005 16:18 GMT
Hi,

Unfortunately I am unable to repro an error where I get a "script.js" error
when I have a .NET solution. For instance, I created a new InfoPath form
and added some invalid jscript code (left off the semi-colon) to the form.
I then created a new .NET InfoPath solution but chose to use the template I
had created above and cannot repro the error.

Are you working with the same forms? What happens if you drill down to the
Debug/bin folder for your InfoPath solution and double-click that XSN
file...what are the results?

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Jerusik - 22 Jun 2005 15:29 GMT
Thanks for the response Scott. I am still having a problem but right now it
isn't a pressing matter. I will attempt to resolve it at a later date. I am
about to post another question now.

Jerry

> Hi,
>
[quoted text clipped - 14 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Alex [MSFT] - 25 Jun 2005 00:05 GMT
I recommend setting up a WhoAmI web service instead:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsrv/html/h
ttpsecurity.asp


Good luck,
Alex

> Thanks for the response Scott. I am still having a problem but right now
> it
[quoted text clipped - 27 lines]
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
Jerusik - 12 Aug 2005 21:42 GMT
Thanks Alex, I just saw your response.

> I recommend setting up a WhoAmI web service instead:
>
[quoted text clipped - 34 lines]
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.