Contact selector Control

Source: Internet
Author: User
Using the contact selector Control

We have seen a number of requests on how to allow a user to enter (or select) a person's name or logon alias and then validate that user against their active directory without using code. this has been especially true in workflow scenarios where user a needs to enter in the name of user B-the next person in the workflow process.

Well, infopath 2007 ships with a control called.Contact selector ControlThat will resolve these issues! You may have seen our older article on the subject; this one aims to dive in deeper.

The contact selector control is an ActiveX control but it is a special cased control, in that it can also be used in infopath browser forms. to use this control there are specific steps that need to be taken-let's take a look at those now.


Step 1: add the contact selector control to your controls task pane

1) from the controls task pane click the add or remove custom controls Link

2) Click the Add button

3) on the first screen of the add custom control wizard select ActiveX Control and click Next

4) from the list of controls, choose contact selector and click Next

5) select "don't include a. cab file" and click Next

6) for binding property select value and click Next

7) from the field or group type Box choose field or group (any data type) and click Finish

8) Click Close and then click OK

 

Step 2: Create the data structure for the contact selector Control

The contact selector control needs to have a specific data structure to work properly-this is already ented on the "items" tab of the properties screen for the control; however, we'll include that information here as well.

** Important! **Spelling and capitalization must be exactly the same, starting with the "person" group!

1) Add a non-repeating group named: gpcontactselector

2) Add a repeating group named: person

3) Add the following 3 text fields to the person group: displayname, accountid and accounttype

Step 3: Add and bind the contact selector control to the view

1) drag the gpcontactselector group to the view and select "contact selector" from the list of controls

2) You're almost done ...!

Step 4: Add a secondary data source XML file which specifies the Sharepoint Server

The contact selector control needs to know the "context" of where the user validation showould occur. these steps are not necessary if you are only displaying the form in a browser from SharePoint-in this case, it uses the context of the site from where it was provisioned; however, if you are in a mixed client/browser scenario you will need to include this XML file so forms opened in the client can use this functionality.

1) Launch notepad

2) copy and paste this one-line XML:

<Context siteurl = "http: // <servername>"/>

** Note: replace <servername> with the name of your server

3) Save this as: context. XML (again-naming and capitalization are important)

4) add context. XML as a "receive" type secondary data connection to your form template and make sure the option "include the data as a resource file" is enabled

Step 5: test!

You shoshould now be able to preview the form, enter a name or logon alias, click the "check names" button and resolve the name! Alternatively you cocould click the "to" button to perform a search if you do not know the complete name of the user.

One other important point: if this control is something you will use numerous times, this process works great to create a "contact selector template part"-then you only have to complete these steps one time!

Scott Heim
Support Engineer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.