Assign value to People Picker programatically in Infopath
As we can assign any field in infopath form using (Eg:TextBox)
MainDataSource.CreateNavigator().SelectSingleNode("//my:RequestedHardware",
NamespaceManager).SetValue("Test");
But when i am assigning the same f开发者_如何学Goor the PeoplePicker field it is giving an exception means which we can't add the value like this. Please suggest how can we programatically do this.... Thanks
How are you setting the value ? Contact selector control requires three values to be set as shown below
- gpManager/Person/DisplayName = PrinciplaInfo/DisplayName
- gpManager/Person/AccountId = PrinciplaInfo/AccountName
- gpManager/Person/AccountType = "User"
Make sure you are setting all three values.
精彩评论