I call it a hack because it was ActiveX, it didn't come with InfoPath 2007, it had some shortcomings, and I do recall running into some rendering issues at times. That will all change in InfoPath 2010.
If you look within the Control Box within InfoPath 2010, you'll see a Person/Group Picker control:
Double clicking on the control adds it to the current form:
The first thing we notice is that we no longer have those large, clunky, VB3.0-style, buttons within the control. Instead of the "To..." button to the left of the text box, there is a directory button all the way to the right. There is still a check-names button but it appears much cleaner and more compliant to people selection interfaces (as used in SharePoint for example).
If you look over to the Fields window you'll notice that InfoPath generates the data schema for you now. We no longer need to create the initial structure and link it to this control or group. The underlying field names are exactly the same as before - meaning it will be easy to upgrade older forms. However, the repeating group is now named "pc:Person" whereas previously it needed to be called "Person". Actually that seems to be for display purposes because if you click and view the properties of "pc:Person" group you'll see that the underlying name of the repeating group is indeed "Person". So I think we are safe with upgrading older forms.
Looking at the control properties, we see many more options now. The first important one is the SharePoint Server:
This is a great option as previously, we needed to deploy the form in order for the people picker to work properly. We can now test the form in Preview mode using the new control. It also appears that, as we will see in the next tab, InfoPath will use the SharePoint groups that are located within the site collection you specify here.
The General tab has the remaining important control properties:
That Allow Multiple Selections is key. Not that you can check it off - but that you don't have to check it off. Confused? In our InfoPath 2007 hack scenario, the contact selector allowed multiple selections and there was no option to tell it to only allow one (1) selection. I needed to generate custom code-behind to enforce only one selection and invalidate the form if there was more than one. This worked but a) since it required code-behind it needed to be deployed via Central Admin, and b) if you dorked around with form enough you were able to eventually trick the validation and get the form to submit with multiple selections. Now we don't need to mess with that!
The next option the General tab is also pretty neat. It controls whether we are allowing People to be selected (specific user accounts) or People and Groups. We can also narrow down the scope of the people that are selected by determining if All Users should be included or just from a specific SharePoint group. This is the drop-down where the SharePoint groups within the site collection (whose URL was entered on the previous tab) are populated:
Previewing the form won't show anything different but will enable those buttons for testing:
Clicking on the directory presents a familiar people search dialog:
And selecting a user shows the fully qualified user account with the famous underline:
Typing in a name and then clicking the Check Names button achieves the same result (just as before).
So the new Person/Group selector is much cleaner from a developer/designer standpoint as well as the end-user standpoint. I "Sent-A-Smile" on this to the Office 2010 product team.









3 comments:
hi steve
what i wanted to know is if based on the user name, i want to get all the other info related to the person, would we then have to create a data connection to the userprofile, or will the selector work.
regards
sunjay
Sunjay, you have to use web service data connection to get additional user profiles properties. Selector retrieves limited information such as id and name.
How to pick the multiple sharepoint Groups in InfoPath form People picker, Could you please help me on this.
Regards
Mad's
Post a Comment