Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am designing a form that basically has two people picker fields.

One is the currently logged in user, and the other is the manager.

What I would like, is that whenever the form is opened, the default value is set to the currently logged in user and the manager, in the respective fields.

Everything works fine in InfoPath when I preview the form, and it loads the user + manager, however, when I upload it to Sharepoint and try to open the form, the error message is as follows:

An error occurred while trying to connect to a Web service.

An entry has been added to the Windows event log of the server.
Log ID:5566

Correlation ID:8890c152-fc77-435a-86b8-f18ce5458adb

Only the currently logged in user is shown, but the manager field is blank.

I have setup the fields as follows:

Created a Form Load in Infopath with two actions

Action one: Set Requestor (currently logged in user)

Condition: none - run when form is opened

Rule type: action, and run these actions:

Set DisplayName = Value[Name="PreferredName"]
Set AccountID = Value[Name="AccountName"]
Set AccountType = User

The Manager field is set similarly:

Set DisplayName = Value[Name="Manager"]
Set AccountID = Value[Name="Manager"]
Set AccountType = User

Oddly when I set the Data Connection for GetUserProfilyByName and set it to not automatically retrieve information every time the form is opened, the error does not show up in Sharepoint, however, neither does the field ...

Does anyone know what the problem is?

Any help greatly appreciated!

Source: http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-2D00-Get-the-current-user-without-writing-code.aspx

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.