Where is the server where you published the form?
If it is on an intranet, it should work, but if it is on the Internet, the
behavior is by design: the form template gets the same permissions that a
web page on the same location would have, and you don't want a web page to
read the username of the logged-in user.
Hope this helps
--Alessandro
This posting is provided "AS IS" with no warranties, and confers no rights.
> In my InfoPath form I am autofilling a textbox with
> System.Environment.UserName as in the MSDN Infopath Training. I then use
[quoted text clipped - 3 lines]
> users to access via a web page link to the form. Anyone have any
> suggestions?
Sushi - 17 Feb 2006 15:31 GMT
The form is published on an intranet, so I don't believe that is the issue.
Would you know if this has anything to do with how I enable full trust?
> Where is the server where you published the form?
> If it is on an intranet, it should work, but if it is on the Internet, the
[quoted text clipped - 15 lines]
> > users to access via a web page link to the form. Anyone have any
> > suggestions?
hobbyman - 22 Feb 2006 20:10 GMT
I was wondering if you ever figured out the answer. I am having the
very same problem and have been working on it for a few days.
--lance
> The form is published on an intranet, so I don't believe that is the issue.
> Would you know if this has anything to do with how I enable full trust?
[quoted text clipped - 18 lines]
>>> users to access via a web page link to the form. Anyone have any
>>> suggestions?
Sushi - 22 Feb 2006 20:23 GMT
I believe it had to do with the order of my code. Here is what I now have, I
hope it helps:
Dim emp As New WebService.Class
Dim ds As DataSet = emp.WebMethod(System.Environment.UserName)
Dim nodeEmpName As IXMLDOMNode =
thisXDocument.DOM.selectSingleNode("my:myFields/my:txtEmpName")
If nodeEmpName.text = "" Then
nodeEmpName.text = ds.Tables("Employee").Rows(0).Item("DisplayName")
End If
> I was wondering if you ever figured out the answer. I am having the
> very same problem and have been working on it for a few days.
[quoted text clipped - 23 lines]
> >>> users to access via a web page link to the form. Anyone have any
> >>> suggestions?
Could you share you code you use to autofill the textbox with
System.Environment.UserName. I need to do that and I haven't been able to
find an example of doing this.
Thanks
> In my InfoPath form I am autofilling a textbox with
> System.Environment.UserName as in the MSDN Infopath Training. I then use
> this field as the login information for a query to a web service. I am
> having trouble with the form retrieving the UserName after I publish it for
> users to access via a web page link to the form. Anyone have any suggestions?