Welcome to MSDN Blogs Sign in | Join | Help

InfoPath Team Blog

Tips and tricks to get the most out of Microsoft InfoPath

News

  • For questions, comments, and feedback please use the public newsgroup: microsoft.public.infopath
    This is provided "AS IS" with no warranties, and confers no rights. Use of included script samples and forms are subject to the terms specified in the Terms of Use.
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 Control that 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 documented 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 should 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 should now be able to Preview the form, enter a name or logon alias, click the “Check Names” button and resolve the name! Alternatively you could 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

Posted: Wednesday, February 28, 2007 7:33 AM by infopath
Filed under:

Comments

olidag said:

"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."

I want to make one of those, too; can you tell me how (or at least point me in the right direction)?  In other words, although creating ActiveX controls has been documented here http://blogs.msdn.com/infopath/archive/2006/12/18/creating-complex-infopath-controls-in-c-sharp.aspx I haven't found similar documentation on making those "Complex InfoPath Controls" also work in browser mode (a.k.a. in InfoPath Forms Server).

Thanks!

- Oli

# February 28, 2007 5:04 PM

infopath said:

Oli,

Unfortunately, there is no way to embed a custom ActiveX or any other custom control into a browser-enabled form template. However, there's a workaround: host a browser-enabled InfoPath form in a custom ASPX page by using the XmlFormView control, and place your custom control into that hosting page. Then, configure events between the form and the hosting page appropriately.

Good luck,

Alex

# February 28, 2007 7:48 PM

olidag said:

Hi Alex and thanks for answering quickly...

I know you can't embed an ActiveX control in the browser version of the form, but presumably this "Contact Selector Control" implements both an ActiveX interface and a "browser-enabled" interface to work in both the rich client and the forms server environments.  The same way the TextBox control, the Date Picker and all of the other "browser-enabled" InfoPath controls do...  What I'm trying to find out is what interface do I implement and/or which attributes do I decorate my class with so that my custom control will count as "browser-enabled".

In case my question is still vague, Bob Mixon and I have posted to the InfoPath newsgroup asking the same question in different terms:

http://www.mcse.ms/message2365411.html

http://groups.google.com/group/microsoft.public.infopath/browse_thread/thread/f58653663a611ea0/846a8677b0308c25

...but we didn't manage to get your attention.

Your assistance in this matter would be greatly appreciated!

- Oli

# February 28, 2007 11:07 PM

infopath said:

Oli, I'm sorry, there really is absolutely no way to do this. The contact selector is a "private handshake" special case. There aren't any interfaces you could implement. No ActiveX or other custom control will work in a browser form, period. This is currently a by-design restriction; we are carefully considering improving this in v.Next.

Try the workaround I mentioned above.

Thanks!

-Alex

# March 1, 2007 12:34 AM

char507 said:

Okay, I have seen this question asked numerous places on the internet and never seen it answered so maybe you guys can help out.  

   Is it possible to add additional fields to the Contact Selector Control?  DisplayName, AccountID, and AccountName are all helpful but we have use for more than just these particular fields.  I know other fields are out there because when I use the contact selector to search for a user, I see other information about them in the Select Names window.  Items such as Title, Department, etc (which are probably unique to our Active Directory).  Is there any way the Contact Selector can pull these fields as well?

# March 1, 2007 10:28 AM

Scott Heim said:

Hi,

I believe the only fields that are available are what you get in the data structure. If you need additional A/D type of information, you can get this through .NET code.

Thanks!

Scott

# March 12, 2007 5:54 PM

Lucian Foppa said:

Hi,

i have a browser form (infopath 2007) which is hosted in a share point 2007

form-libary. In the submit options i defined that the form should be submited

to a mailaccount. That works well, but in the e-mail the contact selector

isn't displayed as text. It's displayed as a blank image, but all other

controls (textfield,datefield) are correctly displayed as text.

Has someone a solution?

I have tried to send the form data as an attachement (in the wizard), but

the mail arrives everytime without the attachement.

Still another question. Is it possible to make a contact selector in a

browser form required?

Greetz Luz

# March 15, 2007 4:50 AM

Scott Heim said:

Hi Lucian,

I am not sure I can reproduce the behavior you are seeing. When I display the form that contains the Contact Selector in the browser and then submit that form via e-mail, in the Preview Pane of Outlook 2007 I don't see a blank image - there just does not appear to be anything there. However, when I actually open that form I see the Contact Selector control - is this what you are seeing or do you actually see a "blank image" of the Contact Selector control?

Regarding how to make this field "required" - try this:

- Remove the "Submit" functionality from the Toolbar (this is an option under Submit Options)

- Add your own button to the form and set its action to Submit

- Add Conditional Formatting to the button such that if the DisplayName field from the Contact Selector group is blank, the Submit button is disabled.

Scott

# March 15, 2007 8:28 AM

Scott Heim said:

Hi Lucian,

One additional comment: if you are indeed seeing the same behavior as I, then this is expected. For security reasons, Active content (i.e. ActiveX controls, and the Contact Selector is an ActiveX control) is blocked in the Outlook Preview Pane.

Scott

# March 15, 2007 8:46 AM

scallin said:

Hi,

First, is there any way to limit the Contact Selector options to members of a single SharePoint group or AD group?

And second, can I limit the control so the user can only select a single person?

Thanks.

# April 9, 2007 4:07 PM

Colaboración SharePoint said:

Hace unos días estaba trabajando con un formulario en InfoPath que publicaba a una biblioteca dentro...

# April 9, 2007 10:55 PM

Scott Heim said:

Hi,

I am looking into your question of limiting the Contact Selector options to members of a single SharePoint or AD group; however, in regard to your question of limiting the control so only one user can be selected - you would need to use custom code on the control to perform a "count" of the repeating node. If there is more than one, then throw an error. Here is some sample code:

** NOTE: "group1" is the parent node of the "Person" repeating node. **

public void group1_Validating(object sender, XmlValidatingEventArgs e)

{

if (e.Operation == XmlOperation.Insert)

     {

      if (e.Site.SelectChildren(XPathNodeType.Element).Count > 1)

           {

            e.ReportError(e.Site, false, "User Selection Error!", "Only 1 user can be selected!");

}

}

}

What this will do is add an error to the errors collection if the contact selector contains more than one entry. Because an error is added to the errors collection, the form cannot be submitted. So although this will still “allow” more than one user to be selected, it does present an error to the user.

# April 10, 2007 11:08 AM

Scott Heim said:

Hi Scallin,

The Contact Selector control is technically not an InfoPath only control so I needed to get a hold of the proper folks to confirm: the Contact Selector control does not have the native ability to restrict users to a single SharePoint or AD group.

I would think though that you could write code on the "Validating" event to perform you own validation of what group the selected user is a part of.

Scott

# April 13, 2007 8:57 AM

zafayar said:

Hi,

Thanks for the great article, would probably save me lot of work.

I have got the control working on my browser form as per your article.  My form is submitting the data to a sharepoint form library, and all is well in that area too.  

Now I need to do 2 things:

First, I would like to promote the selected contact to a column in sharepoint library.  This is so that the column can be filtered by current user.  

second, I would like to pre-fill the control with value that i get from AD using code.  Any comments on that ??  I can access full user details from AD, so the only problem is to fill it properly in the controls data structure.

Thanks,

Raj

# April 15, 2007 6:48 PM

Scott Heim said:

Hi Raj,

InfoPath 2007 does not support promotion into a Person or Group field - what may work is to create another node in your data source (it does not need to appear on the view) and set the default value of this to either the Display Name or AccountId field and then promote this field. Obviously this will simply be a text data type and not a Person or Group field.

Regarding how to populate the fields appropriately, you will need to set the value of the DisplayName and AccountId fields. The AccoundId is merely domain\user; however, in my testing it appears this is case-sensitive. As an example, the following does work for me:

domain\user

But what appeared in the Display Name field was: "FirstName LastName <domain\user>"

Whereas when I changed this to:

DOMAIN\user

Then the only thing that appeared in the Display Name field was: "FirstName LastName"

I would suggest for testing that you simply drag the Person group to your view as a Repeating Section with Controls, select a value using the Contact Selector control and you will see how these fields are populated.

Scott

# April 16, 2007 8:37 AM

Andy65 said:

Hi,

"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!"

There is only one problem with this great idea and that is that ActiveX controls are not supported in template parts. At least that is what it says when I try.

Andy

# April 16, 2007 12:35 PM

Scott Heim said:

Hi Andy,

My apologies for the confusion - what I was referring to was the process of creating the data structure needed for the Contact Selector control. You are correct - ActiveX controls are not supported but you can create the data structure so that all you need to do is add that template part to your new XSN and bind the Contact Selector control to that data structure.

Scott

# April 16, 2007 12:55 PM

zafayar said:

Hi Scott,

Thanks for the reply,

I figured out by trial and error on how to pre-populate the control, the same way that you mentioned.

But still one of my problem remains.  What i need to do is perform a basic workflow on the submitted form.  Once the form is submitted, it is assigned to the user selected from the contact selector.  This part is done.  What i want to provide is the view to users so that they can only see the forms submitted to them.  I tried putting all possible values in the fileld (username, domain\username etc), but it still would not filter with [Me] or [Current User].  Is there any way to do this kind of filtering ???

Thanks for your help,

Raj

# April 16, 2007 5:09 PM

Scott Heim said:

Hi Raj,

Not trying to "pass the buck" on this but the filtering functionality is a feature of SharePoint - if this is not working as you need, you would probably be better served to post that question to one of the SharePoint groups.

Scott

# April 16, 2007 5:33 PM

scott.lewis said:

Is it possible to use the Contact Selector control on clients that only have InfoPath 2003 installed?  I have created a form in InfoPath 2007 and would like to allow users with only 2003 version to use it.  (Distribute/install the ActiveX control without having to install Office 2007?)

-Thanks, Scott

# April 20, 2007 4:53 PM

Scott Heim said:

Hi Scott,

This is not a supported scenario - the Contact Selector control requires some 2007 files hence your users will need to have Office/InfoPath 2007 installed on their machines.

Scott

# April 26, 2007 8:13 AM

Collaboration Ipso Facto said:

More often than not, while working on custom workflow LOB (Line of Business) applications, we usually

# May 5, 2007 12:30 PM

Collaboration Ipso Facto said:

More often than not, while working on custom workflow LOB (Line of Business) applications, we usually

# May 5, 2007 12:47 PM

neoearth said:

Very Cool Control! But.... :-)

How does one utilize more than one Contact Selector control on a form?

# May 21, 2007 5:52 PM

Scott Heim said:

Hi neoearth,

Assuming you have followed the naming conventions in this post, you have a group node named: gpContactSelector under the "myFields" node. To utilize another Contact Selector control:

- Add a new group node under myFields named, for example, gpContactSelectorNew

- Expand the existing gpContactSelector node

- Right-click on the Person repeating node and choose Reference

- Select the new group node, gpContactSelectorNew, and click OK

- You should now see the Person node under gpContactSelectorNew - simply drag gpContactSelectorNew to your view and select Contact Selector!

Scott

# May 22, 2007 1:56 PM

brett.c said:

Hi Scott,

Following up on the discussion regarding adding more than one Contact Selector Control to a form, I have a form and am trying to:

- Add more than one (2 specifically...lets call them csA and csB) CS ctrl to each form, and

- Perform a "required field" validation against both of these

I've tried to implement this logic by using the technique you discussed on March 15 (remove the default form Submit feature & control the submit through a custom submit button with some conditional formatting). However, it doesn't work: when trying to make conditional formatting references to the 2 seperate DisplayName fields within the 2 seperate Person nodes of both the csA and csB contact selectors respectively, filling in *either* contact selector will cause the submit button to become enabled.

In addition, we've tried other techniques, such as checking for fields (marked as required) associated with specific Person nodes, copying data to them using rules, and setting the default values to DisplayName node, amongst others. None of them seem to work (most of the form rules and field updates seem to trigger on submit, which is too late).

Do you know, or can think of any way we can host more than one Contact Selector on a form *and* perform "required field" validation against both??

Loving the blog, and thanks for your help in advance!

Cheers, Brett

# May 24, 2007 4:09 AM

Scott Heim said:

Hi Brett,

I am not sure I am seeing the same behavior as you - here is what I tested:

- Added 2 CS controls as per my prior steps

- Added a button control to the View

- Added the following Conditional Formatting to the button to disable the control:

DisplayName -> Is Blank (this points to DisplayName under group1) or

DisplayName -> Is Blank (this points to DisplayName under group2)

If you then choose "The Expression" from the first dropdown box, my Conditional Formatting looks like this:

my:group1/my:Person/my:DisplayName = "" (or)

my:group2/my:Person/my:DisplayName = ""

Now, if I Preview this form and enter a name in CS1, the button remains disabled. However, once I add a name to CS2 the button becomes enabled.

Am I doing something in error?

Scott

# May 24, 2007 10:40 AM

brett.c said:

Hi Scott,

No, you're doing it right, I'm an idiot! I just realised that the behaviour was not actually due to the contact selectors, but to something else I'd left in my overly complicated form from when I was trying to get it to work. When I replicated your test on a fresh form, it worked great!! Sorry I ever doubted! :)

FYI, I've noticed that this technique will only work on the "first use" of the control; if you populate the control, and later clear it, required field validation will not be able to pick up the change, obviously because the DisplayName node still holds a value. It's not easy to clean this up without reverting to custom code, is it?

Thank you very much for you timely help and assistance! Now loving the InfoPath blog even more!!

All best, Brett  :)

# May 24, 2007 11:53 PM

Scott Heim said:

Hi Brett,

Glad you were able to isolate the problem! In regard to what happens after you clear the user from the CS control, you can better see this by dragging the "Person" node to your View as well. When you enter a user in the CS control and click the button to validate the user, you will see the associated fields get filled in; however, when you simply clear that user from the CS control those fields do *not* get cleared until you validate the user. Now - at that point, not only do those fields get cleared the node gets removed entirely. So, to make this work you will need to modify the Conditional Formatting on the button:

Display Name is blank (for the first CS) (or)

(Choose The Expression) count(my:group1/my:Person) = 0 (or)

Display Name is blank (for the second CS) (or)

(Choose The Expression) count(my:group2/my:Person) = 0

What this will do is disable the button when: either control is blank or once you delete the user and click the button to validate the user.

Short of this, you would need to write code to see if anything else would work.

Scott

# May 25, 2007 9:06 AM

Rudolph's Blog said:

The contact selector control in InfoPath 2007 is quite handy for users to select a person from active

# June 19, 2007 11:38 AM

levy said:

Hi,

Thanks for the wonderful tips on the Contacts Selector. I have used a contacts selector on a form and it works fine.

However, I need the form to be submitted to a document library with a name generated from the user's name, and a link to the saved document to be sent to the person selected on the contacts.

When using infopath, this works fine but when i publish the form and fill on the browser, it saves in the library but does not send e-mail.

I am submitting the form using a rule that uses 2 data connections, 1 to submit to the library and 1 to e-mail.

What could be the problem is not submitted to e-mail from the browser?

# June 21, 2007 1:46 PM

infopath said:

Hi levy,

Keep in mind, when sending mail from a browser form it will be sent via the mail services setup on the server. Have you setup SMTP mail?

If so, have you confirmed it is working? For example, can you add an "alert" to a list and actually get that mail?

Scott

# June 21, 2007 2:09 PM

levy said:

Hi Scott,

SMTP is currently configured on the server

e-mails/alerts are going through. i just added an alert and received the notification

# June 21, 2007 2:24 PM

levy said:

The data connection that sends the e-mail is set to "send only the active view ......". The summary after customizing is:

Type: Submit Data

E-mail Subject (expression): concat("http://enation2/SiteDirectory/HR/_layouts/formserver.aspx?XmlLocation=/SiteDirectory/HR/Investment%20Trust%20Fund/Monthly%20Contributions/", translate(MemberFullName, " ", "_"), ".xml&OpenIn=Browser")

To (expression): DisplayName

cc:

Bcc:

View Only

# June 21, 2007 2:33 PM

infopath said:

Seems like it should work - is there anything in your Application Event log or the SharePoint server logs or the SMTP service logs that would provide a clue?

Scott

# June 21, 2007 5:56 PM

松崎 剛 ブログ (Tsuyoshi Matsuzaki Blog) said:

環境: Microsoft Office SharePoint Server (MOSS) 2007 Visual Studio 2005 SharePoint Server 2007 SDK and

# July 12, 2007 4:43 AM

Noticias externas said:

環境: Microsoft Office SharePoint Server (MOSS) 2007 Visual Studio 2005 SharePoint Server 2007 SDK and

# July 12, 2007 5:17 AM

cfarkal said:

Hi Scott,

Question on resolving lastname, firstname in the contact selector.  I am populating this control via a database with a name and am having problems getting the name to resolve.  Even though the name should resolve it is only looking at the last name then automatically entering a semicolon -   lastname; firstname.  It is treating it as 2 different names.  I need this to resolve by populating the person's name so the person submitting the form can see who it's going to.

I am using the GUI to design this browser form.  Please help!  

thanks!

# July 27, 2007 1:15 PM

infopath said:

Hi cfarkal,

As you have probably tested, it is not just when you programmatically set the name as: last, first - if you just type it in this way it does not resolve.

The Contact Selector control is technically a SharePoint control and without debugging into the control, I am not sure why it does not like the name in this format. So - why not just format the name as: first last?

Here is some sample code:

XmlNamespaceManager ns = this.NamespaceManager;

XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();

XPathNavigator xnCS = xnDoc.SelectSingleNode("/my:myFields/my:gpTasks/my:gpTask/my:gpContactSelector/my:Person/my:DisplayName", ns);

string strName = "Heim, Scott";

int intLoc = strName.IndexOf(",");

string strFormattedName = strName.Substring(intLoc + 2) + ' ' + strName.Substring(0, intLoc);

xnCS.SetValue(strFormattedName);

Scott

# August 2, 2007 4:02 PM

daska said:

Hi Scott,

Excellent article! In the last paragraph, you suggested we could create a template part using the Contact Selector but I get "ActiveX controls are not allowed in Template parts" error when I try to add contact selector to the form. Could you kindly elaborate on how we can add contact selector to the template part?

Thanks,

Daska

# August 8, 2007 4:44 PM

infopath said:

Hi Daska,

Yes - I should have been more clear on this - my apologies. What I was referring to was creating a template part of the "data source" - this way you don't have to keep recreating this each time. You can just add the template part containing the data source and just drag it to your View (it shows as a section.) Once there, just right-click on the Section choose Change To and choose Contact Selector!

Saves a fair amount of time...

Scott

# August 8, 2007 4:57 PM

daska said:

Thanks for the quick response Scott! I really appreciate it. It works but now the problem is that entering a value in one control shows that value in other controls too. For example, if i use the template part multiple times on the same form, then entering the value in one control populates all the controls on the form. How can I resolve this? I will appreciate your feedback on this.

Thank you very much.

Daska

# August 8, 2007 5:24 PM

infopath said:

Ah - now that is a bit different! :)

To use multiple Contact Selector controls, you would need to do this:

- Add the Template Part *once* to your View and change it to a Contact Selector control as noted before

- To add another one:

    - In the Data Source Task Pane, right-click on myFields and choose Add

    - Enter a name (i.e. CS2) and set the Type to Group (NOT repeating)

    - Expand the Template Part data source, right-click on the top group (i.e. gpContactSelector) and choose Reference

    - Select the new CS2 group and click OK. The appropriate data structure is added for you! Now, just drag the new gpContactSelector to the View and choose Contact Selector control.

Scott

# August 8, 2007 5:37 PM

daska said:

Thank you very much Scott. It worked.

Regards,

Daska

# August 9, 2007 12:26 PM

daska said:

Hi Scott

I have a problem. I am publishing the InfoPath form (with contact selector control) in a SharePoint library. The value selected in the contact selector control does not appear in the SharePoint library. I have been trying to find the solution since morning but with no luck. While publishing 'DisplayName', i select 'first' function from the list of available functions. The 'DisplayName' property is created in the library but the value does not show. Any ideas?

Thanks,

Daska

# August 9, 2007 4:50 PM

infopath said:

Hi Daska,

That's odd - this works perfectly for me. In fact, I added both "Display Name" and "Account Id" as promoted columns and I see both get populated when I submit or save the form to the library.

For testing purposes, create a new form template with just one Contact Selector control and see if this works for you. If so, let me know what is different that is not working for you.

Scott

# August 9, 2007 5:15 PM

daska said:

Is there any possibility that this might be happening because I am not on a domain? I am using a virtual PC and I am not on a domain. I am logged in as a local machine admin.

Thanks,

Daska

# August 9, 2007 6:21 PM

infopath said:

Hi Daska,

I am not sure - that may be the cause. I would test with just the form template created in this post just to be sure.

Scott

# August 10, 2007 8:38 AM

jwstrat said:

Scott:

We are using the Contact Selector control on an InfoPath form that is being used as a Workflow Task form in a SharePoint 2007 workflow.   The portal users are members of an Active Directory group named "Portal Members" and this group is a member of a SharePoint Site Group.  The Contact Selector will allow the user to select anyone in the "Portal Members" group but unless the person selected is in the "All People" list on the portal they don't actually get assigned to the workflow task.   I'm not sure if this is an InfoPath problem or a Workflow problem - any insight would be greatly apprceiated.

Thank you,

Josh

# August 30, 2007 10:06 AM

infopath said:

Hi Josh,

Actually this is a SharePoint control - I would suggest starting with that group. It may be a workflow issue but I am not sure.

Scott

# August 30, 2007 5:11 PM

Mirrored Blogs said:

Body: Para que septiembre no se vaya en blanco, aqui les comparto algo que nos anduvo dando algunos dolores

# September 24, 2007 7:24 PM

Pedro Pablo's Playground said:

Para que septiembre no se vaya en blanco, aqui les comparto algo que nos anduvo dando algunos dolores

# September 24, 2007 7:39 PM

marci737 said:

Hi all!

I made a contact selector. I want to select one ore more users, get their DisplayName and AccountID.

So far ok, but now, I want to add a CheckBox and a Dropdownlist to each selected Person. So I want to extend my contact selector so, that I can fill these extra fields. If I add these controls to the Contact Selector, these fields are dimmed, I cannot type in or select any values.

How can I do this using an other way?

# October 8, 2007 7:27 AM

infopath said:

Hi marci737,

Assuming you are trying to achieve a scenario where you can "select" multiple users, here is one way to get this to work:

- Modify your data source so that "group" for the Contact Selector control is under another "repeating group." For instance, here is how this Blog sample was designed:

- gpContactSelector (non-repeating group)

    - Person (repeating group)

         - DisplayName

         - AccountId

         - AccountType

You could modify it like this:

- NewRepeatingGroup (repeating group)

    - gpContactSelector (original non-repeating group)

         - Person (original repeating group)

              - Etc.

Then, under the new "NewRepeatingGroup" you would have your checkbox and dropdown list nodes. You could then drag the NewRepeatingGroup to your View and choose Repeating Table. This will add the Contact Selector fields as an "Optional Section." Just delete this and drag the "gpContactSelector" group to that first column and choose Contact Selector from the control choices.

Now, when you Preview this form you can enter a name in the Contact Selector control, validate it and the check box and dropdown lists are still available!

I hope this helps...

Scott

# October 8, 2007 9:35 AM

marci737 said:

Hi!

Thanx for the feedback, but it is not exactly what I wanted to do. :(

So: I have a contact selector. I fill this with names for example: marci737;infopath;chuck;teddy. The names are separated with ";". When I validate them, I want them to appear in a new repeating table so:

------------

displayname

accountid

accounttype

dropdownlist

checkbox

------------

displayname

accountid

accounttype

dropdownlist

checkbox

------------

displayname

accountid

accounttype

dropdownlist

checkbox

This would be the input for the next form.

# October 9, 2007 3:50 AM

infopath said:

Hi marci737,

There is no way in the UI to accomplish this - you will need to write custom code to accomplish what you are asking.

Scott

# October 9, 2007 11:15 AM

caseycase said:

This works great for me - however, how do I set the default to be the current user?  I know where to do this... DisplayName, right click properties, default.  I just don't the formula or the value to put in there.

# October 10, 2007 10:50 AM

infopath said:

Hi caseycase,

I am assuming that not only do you want to have a default user specified but that you also want that name "resolved" as if you clicked the "Check Names" button on the Contact Selector control - correct? If so, there are a few things you will need to do for this to work.

Clicking the Check Names button calls SharePoint's "people.asmx" web service to resolve the name. So in order for us to do this automatically, we will need to add this web service as a data connection, set the appropriate queryFields and then execute the connection. Here are the steps you will need to follow:

- Add a web service "receive" data connection to the "people.asmx" web service to your form template. NOTE: Make sure you uncheck the option to automatically get the data when the form loads.

    - The URL for this will be something like this: http://server/_vti_bin/people.asmx

    - Select the ResolvePrincipals method

    - Complete the wizard

- From the Tools menu choose Form Options -> Open and Save

- Click the Rules button

- Click Add Action

    - Set a field's value

    - The field is named "string" from the ResolvePrincipals queryFields

    - The value will be the "DisplayName" field from your Contact Selector data source (the default value for this will be domain\username)

- Click Add Action

    - Set a field's value

    - The field is named "principalType" from the ResolvePrincipals queryFields

    - Copy and paste this as the value: User SecurityGroup SharePointGroup DistributionList

- Click Add Action

    - Query using a data connection

    - Data connection: ResolvePrincipals

- Click Add Action

    - Set a field's value

    - The field will be the DisplayName field from your Contact Selector data source

    - The value will be the DisplayName field from the "dataFields" of your ResolvePrincipals data source

- Repeat the above action to set the following fields:

    - AccountId from Contact Selector equals AccountName from ResolvePrincipals dataFields

    - AccountType from Contact Selector equals PrincipalType from ResolvePrincipals dataFields

So now if you set the default value of the DisplayName field to domain\user, it should auto resolve when the form is opened.

I hope this helps!

Scott

# October 10, 2007 12:05 PM

caseycase said:

Wow, lots of information here, thank you!  I followed your instructions exactly and everything you said was where it was supposed to be, very impressive.  

It appears to be working by doing the user check, but how do I get the default value to read the Current User who is filling out the form?

# October 10, 2007 4:26 PM

infopath said:

Hi caseycase,

Glad that helped!

Try this:

- Remove the hard-coded user name from the default value

- Click the "fx" button

- Click the Insert Function button

- Select the All category

- Scroll to the bottom of the Functions list and select userName

- Click OK until you are back to your form

- Test! :)

Scott

# October 10, 2007 4:36 PM

caseycase said:

That worked!  Thank you very much - thank you especially for responding so quickly.

# October 10, 2007 4:53 PM

infopath said:

Glad to help!

Scott

# October 10, 2007 4:58 PM

infopath said:

Hi arttu_123,

In regard to your question of using the Contact Selector control in a Document Information Panel - I don't know that I am seeing the same results. Here are the steps I followed:

- Created a new Document Library named: ContactSelectorTest

- Enabled the option: Allow management of content types

- Added a new column to this library named: Responsibilities and set the data type to Person or Group

- Clicked the Document Content Type and selected Document Information Panel settings

- Clicked Create a new custom template

- Reviewed the data source and it matched what you are seeing:

p:properties

 :documentManagement

    ns2:Responsibilities

       UserInfo

          DisplayName

          AccountId

          AccountType

- Published this back to my library as a Document Information Panel (default option)

- Clicked New to create a new Word document

- Entered my user name in the Contact Selector control and clicked the "Check Names" button - result: resolved my name

- Clicked the Add people from Address Book button, entered a co-workers user name, clicked the Go button, selected that user, clicked Add and then OK - result: that user's name was displayed in the Contact Selector control.

Am I doing something differently than what you are trying to accomplish?

Scott

# October 15, 2007 10:10 AM

thunderstorm said:

Hi,

Brilliant post, helped me loada already! :)

Relly annoying that you can't promote to a person or group field in SP however..

So I wondered is there a way to get the actual email address instead of the account ID or display name? I think this would look better in a column instead of the account ID.. but is it possible? :)

Thanks!

# October 15, 2007 11:50 AM

infopath said:

Hi thunderstorm,

The Contact Selector control will only be able to obtain the data for those fields that you see in the data source. You may be able to use the value returned in the AccountId field to query your Active Directory to return this information.

The other possibility is if you have a configured profile database, pull the information from here as well.

Scott

# October 16, 2007 9:11 AM

anca_accenture said:

Hi Scott

Very nice post here, helped me alot.

I have the folowing issue: I'm trying to use Contact Selector on a Modification Form for my workflow.  When I want to add a new Contact on that form, it gives me the following error: "'my' is an undeclared namespace: Line 1, Position 2" + StackTrace.

Thanks!

Anca

# October 16, 2007 9:55 AM

infopath said:

Hi Anca,

Does the same error occur if you simply double-click (launch) the InfoPath form outside of your workflow? I just want to be sure this is not specific to your workflow process.

In short, it sounds like you are maybe using code to reference one or more nodes and have not declared the appropriate namespace.

Scott

# October 17, 2007 8:56 AM

anca_accenture said:

Hi Scott,

Sorry I was so brief in my last post.

Basically I tried to deploy the form in a non workflow context, just publish the form and then test it. It works (both in infopath and browser) , so it's not something strictly related to the form !

In the stack trace I can see that AppendChild() is called and with that also NamespaceLookup() and that is where the exception gets thrown.

I don't really understand because the same methods are called when I test my form in a non workflow related environment, and it works.

Thanks,

Anca

# October 17, 2007 11:10 AM

arttu_123 said:

Hello Scott,

Actually when creating a new document information panel for that content type, I've been editing the current template, instead of creating a new one, otherwise I've been doing the same as you - appearantly with different results.

However, I followed your steps to the letter on our staging site, and everything worked flawlessly and the contact selector works properly. The same method did not work on our production site though.

When I try to create a new custom template I get an error message that I self atleast cannot interpret:

"InfoPath cannot open the following form: C:\Documents and Settings\username\Local Settings\Temporary Internet Files\Content.MSO\D60BC53.tmp\customXsn.xsn"

And in details:

"The form definition (.xsf) file contains elements, attributes, or structures that are not valid.

Error details:

'list_' is a duplicate key for the unique Identity Constraint '{http://schemas.microsoft.com/office/infopath/2003/solutionDefinition}dataObjects_name_unique'.

Line 155, Position 4

</xsf:dataObjects>

---^"

I'm all baffled about this message and I've been trying to fix it myself.

Oddly enough I've been having lot's of problems with InfoPath when working directly with our production site and none when working with any other web application.

So the main problem isn't fixed yet though. I've been editing the current xsn template and manually added the contact selector control there and binding it to the Responsibilities data source. I can still type in some text to the text field and browse through the address book. But when I either try to click the 'Check names' or after cliking OK in the address book, nothing happends - nothing appears in the text field.

I'd think that the contact selector would start working properly aswell if I could get that "Create new custom template" working. I just hope that it's some small strange bug and not something with the whole web application.

Thanks in advance,

Sebastian Eriksson

# October 17, 2007 11:37 AM

infopath said:

Anca - have you added custom code to your form? Are you 100% sure this code gets executed in a non-workflow scenario?

Sebastian - what happens if you create a new test document library and attempt to create a new custom template - do you still get the error? I am wondering if this is site or library specific?

Scott

# October 17, 2007 5:26 PM

arttu_123 said:

Hello Scott!

Ah yes, it does actually work when I create a new document library in the same site. Well I guess this solves my problems then, a bit work to add all the columns and content types to the new library, but nothing too much. The cause of that error still eludes me though. But hey, all that matters is that it's working now :)

Thank you

Sebastian

# October 18, 2007 5:47 AM

arttu_123 said:

Hello again,

I actually figured out why I kept getting that error message when trying to create a new custom template in a document library. One of my custom content types used in that document library uses two lookup colums which get the information from another list in my sharepoint site. For some reason when I create a new template, InfoPath sets the data source for those columns as a list named just "list_", and it only has a value @ID, nothing else.

And when I had those two lookup columns in one content type they both used the dataObject name 'list_'.. hence the "'list_' is a duplicate key for the unique Identity Constraint" error. I can get it properly working when I remove the second lookup column from the content type and manually readjust the data source of the first lookup column after "Create a new custom column". Do you think this is a bug or just something with my site collection?

In short: I have two sharepoint lists and one document library with a custom document content type that has lookup columns to fetch information from those lists. InfoPath sets the data source for these columns wrong, when trying to create a new DIP template for the document content type.

# October 18, 2007 6:33 AM

anca_accenture said:

Hello Scott,

No, my form has no custom code in it. My form only has a contact selector configured as you described it here, and a Submit button.

I designed this simple form to use it in order to reassign a task to another person in a workflow. So when I try to add a contact in the control it shows me that error.

I'm sure it works in a non workflow context.

Thanks,

Anca

# October 18, 2007 8:05 AM

infopath said:

Sebastian - that is great to hear that a new library works. Like you, it is interesting as to why the original did not but at this point, it is probably not worth spending a lot of time trying to isolate the cause.

arttu_123 - thank you for the update! I am not sure if this would be expected or not - if you would like to pursue this, I would suggest opening a support case and please provide us with the steps to reproduce the behavior. It sounds like it could be an issue so we should probably look into this further.

anca_accenture - thank you for the additional information. Can you confirm something for me: if you remove the Contact Selector control from the form, it then works in your workflow?

Thanks all,

Scott

# October 18, 2007 10:00 AM

caseycase said:

Hi Scott -

I need help with throwing an error message to the user when they try to enter multiple contacts.  I read your blog entry where this was covered above - however, I am not sure where to put the code.  Would this be part of the Submit options?  I couldn't find a place in there either.

thanks

# October 22, 2007 1:32 PM

infopath said:

Hi caseycase,

The code shows where it goes:

** NOTE: "group1" is the parent node of the "Person" repeating node. **

public void group1_Validating(object sender, XmlValidatingEventArgs e)

{

if (e.Operation == XmlOperation.Insert)

    {

     if (e.Site.SelectChildren(XPathNodeType.Element).Count > 1)

          {

           e.ReportError(e.Site, false, "User Selection Error!", "Only 1 user can be selected!");

}

}

}

Using the sample from the post, "group1" is the parent node of the "Person" repeating node. So as you see in the code, there is a "Validating"event on group1. What you need to do is:

- Display the Data Source Task Pane

- Right-click on group1, select Programming and then choose Validating Event

You will then get an empty event. Add the following code to that event:

if (e.Operation == XmlOperation.Insert)

    {

     if (e.Site.SelectChildren(XPathNodeType.Element).Count > 1)

          {

           e.ReportError(e.Site, false, "User Selection Error!", "Only 1 user can be selected!");

}

}

Scott

# October 22, 2007 4:00 PM

caseycase said:

Thanks, I will try it, right now this option is grayed out until I get the VSTA downloaded and I am unsuccessful in doing so, I keep getting redirected to all kinds of links.

On another note, during form field promotion, I am trying to promote one of the fields in the gpContactSelector to an existing site column called Associate Name that will show Presence.  I am trying to merge the DisplayName into the Associate Name column and receive this error:

"The data type of the selected site column does not match the data type of the field to promote" - I also tried AccountId and AccountType, none of them work.  

Do you know a workaround?

# October 23, 2007 9:57 AM

infopath said:

Hi caseycase,

Unfortunately I don't know of a workaround other that what I suggested earlier in this blog - the difference is that field will simply be a text field containing the AccountId or DisplayName of the user, which means Presence will not be available.

Scott

# October 23, 2007 3:15 PM

SharePoint Land said:

Para que septiembre no se vaya en blanco, aqui les comparto algo que nos anduvo dando algunos dolores...

# October 24, 2007 5:09 PM

hwg_Maarten said:

I added the Contact Selector web part to a browser form, and I can select users properly from the sharepoint hosted environment.

However when I go to send an email using the contactSelector group as the data field, it tries sending to lastname@domain.com instead of the proper ad email address which is first.lastname@domain.com, am I pointing to the wrong part of the datasource or am I doing something wrong here?

Thanks

Maarten

# November 1, 2007 10:34 PM

infopath said:

Hi Maarten,

When you select a user in the Contact Selector, is the name returned as first.lastname in the control?

Also - drag that node onto your view as a Section with controls so you can see each node and make sure DisplayName and AccountId show the same information.

Scott

# November 2, 2007 2:03 PM

kristina.fitzgerald said:

Hello InfoPath Gurus,

I am following the directions you outlined for caseycase above and the Contact Selector automatically populates with the resolved name to the current user when the form is opened (Perfect, thanks.). The problem I’m experiencing is when a user enters a new name and resolves it, the returned value is: <currentUser> <newName>, even if the current user value is cleared from the Contact Selector before the new name is entered. Is your solution above meant to allow for a different name to be entered (the traditional use of the Contact Selector) or does it limit the control to the current user with appended names? Thank you for any information you can provide. - K

# November 27, 2007 11:56 AM

infopath said:

Hi Kristina,

I see what you are saying...sorry about that. Try these modifications:

- Remove the userName() function from the DisplayName field

- From the Tools menu choose Form Options -> Open and Save category

- Click Rules (you should see one rule created above)

- Click Modify

- Click Add Action

    - Action: Set a field's value

    - Field: Pick the DisplayName field from your main data source

    - Value: Click the "fx" button and insert the userName() function

- Make sure this new action is the first item in the list of actions

This will still populate the "default" value to be the user that opened the form but if the user enters a new value in the control, it now appears to resolve correctly.

Scott

# November 28, 2007 11:31 AM

kristina.fitzgerald said:

Hello Scott,

Your solution seems to work fine until I apply the validation code that you supplied above for limiting the control to a single entry. Somehow the ResolvePrincipals method is incrementing the person count on the Contact Selector, and not showing the accurate count after the first person is removed and replaced. Is there a way to force the count back down to 0 when the field is cleared? Thanks again for all your help. – K

# November 28, 2007 6:00 PM

infopath said:

Hi Kristina,

I don't believe I am seeing the same behavior - here is what I tested:

- Made the modifications noted above to the Rule on the Form Open

- Added the code to insure only 1 user could be added

- Launched the form - result: my user name is populated and resolved

- Deleted myself from the Contact Selector and entered a co-workers name

- Clicked the Check Names button - result: name is resolved and no error about the number of users

Am I doing something different?

Scott

# November 29, 2007 8:21 AM

kristina.fitzgerald said:

I apologize Scott,

Somehow I was applying the validation code to the “Person” group rather than the Contact Selector group. I was too quick to post. Sorry! :-) This is a great thread. Thank you for responding so quickly and thoroughly. InfoPath can be a bear for beginners, but it would be impossible without these forums. Thanks again. – K

# November 29, 2007 11:14 AM

infopath said:

No problem - I am glad it works for you!

Scott

# November 29, 2007 11:16 AM

ing_marco said:

Hi.

I have problems when I try use CS with TNS name space.

Do You know how fix it?

# January 4, 2008 10:45 AM

infopath said:

Hi ing_marco,

A few more details would be helpful. What have you done so far, what error are you receiving, does this sample even work, etc.

Scott

# January 4, 2008 11:41 AM

Mirrored Blogs said:

In part one I created an InfoPath form that employees could use to create a work schedule. Now I&#39;m

# January 9, 2008 7:53 PM

rjburke said:

Contact Selector works as described.  Excellent.  

I have one issue: I need to be able to retrieved disabled AD accounts.  We have field workers that do not frequently login, the accounts become disabled based on our security policy.  Their Supervisors need to fill out forms on their behalf.  The disabled accounts do get imported into SharePoint User Profiles database.  Any thoughs?

# January 24, 2008 2:07 PM

infopath said:

Hi rjburke,

You will probably be better served posting that question to a SharePoint Newsgroup.

Scott

# January 24, 2008 2:17 PM

dtrodler said:

Hello Scott,

I have a problem using the contact selector control in DIP for a content type. The contact selector works fine when the DIP is generated from scratch using sharepoint content type management UI, but it doesn't work when the DIP is modified from parent content type DIP.

In my scenario I have a tree of content types going from very generic ones to very specific ones. Since the generic (parent) content type already contains some code and external data connections, I do not want to recreate the DIP for each child content type from scratch, but instead I just want to modify the parent content type DIP.

Unfortunately, if the child content type contains a new field of user/group type and I follow instructions in your article to add the contact selector control, I can select a specified user but the value doesn't bind. I think that the problem lies in the fact that the top level node is called UserInfo instead of Person. When the DIP is created from the scratch there must be some internal plumbing going on which resolves this issue.

# February 18, 2008 10:31 AM

infopath said:

Hi dtrodler,

Correct - that repeating node must be called Person in order for this to work correctly.

Scott

# February 18, 2008 4:24 PM

dtrodler said:

Hello Scott,

thanks for the prompt reply. Is there any workaround? The DIP schema is read-only and I cannot rename that node.

I think that reusing DIP from parent content type in child content types is quite common scenario and it would be nice to know how to use the contact selector in this case.

Can you give me some information how it is done when the DIP is generated from scratch in sharepoint UI? The contact selector works in this case even when the repeating node is called UserInfo . I guess that some modification of the DIP form source files would help. Is there any documentation on this?

Daniel

# February 18, 2008 4:59 PM

mmattson said:

Hello Scott,

When I type in a keyword and click Go I get: Search Failed. I have my Context.xml file pointing to my sharepoint site. We are currently using Microsoft Windows SharePoint Services 2.0 with InfoPath 2007. Any Ideas?

Thanks!

# February 18, 2008 5:39 PM

dtrodler said:

Hello Scott,

I think I have found a workaround for the "non-binding contact selector in derived DIP" problem.

1.  Create content type A and generate its DIP using sharepoint UI (click "create new custom template")

2. Modify the DIP as desired by adding external data connections, code etc..

3. Create content type B which derives from A and has an additional field of type user

4. Create its DIP by modifying A content type DIP (in sharepoint UI click "edit this template" instead of "create new custom template")

5. In Infopath designer select "Convert Main Data Source" to update the schema to match the B content type

6. Place the contact selector control on the form and bind it to your user field. (to the group node above the repeating UserInfo node)

7. Save the B DIP form source files to "BDIPfromParent" folder

8. Go to sharepoint UI and generate DIP for content type B again, this time from scratch (by clicking "create new custom template") - this will generate DIP with working contact selector control (but unfortunately all A content type DIP design is lost)

9. Save the source files of this DIP form to "BDIPfromScratch" folder

10. Open the file view2.xsl which is the stylesheet for the document management fields from the BDIPfromScratch folder and locate the contact selector control node (clsid:61e40d31-993d-4777-8fa0-19ca59b6d0bb)

11. Copy the entire param section of this node

12. Open the view2.xsl file from the  BDIPfromParent folder and located the contact selector control

13. Replace the param section with the copied section.

14. Make sure that the namespace prefix used in individual parameters corresponds to the same namespace as in the BDIPfromScratch view2.xsl

15 Open the resulting form (by opening the manifest file in infopath) and publish it as a DIP for the B content type - you should have a working contact selector with your parent content type DIP design preserved!

Daniel

# February 19, 2008 5:02 AM

infopath said:

Hi Daniel,

Glad you were able to get a workaround!

Scott

# February 19, 2008 8:11 AM

mmattson said:

Hello Scott,

I sent a message yesterday. Here's more information. We are in the process of upgrading to SharePoint 2007. We are currently using SharePoint Services 2.0. Followed the information above to build the contact selector control but It's not making a data connection. The error I get is "Search Failed". I have administrator access to the site. I've tried it on a blank template, with the same results. Will this work with SharePoint Services 2.0 or do I need to wait until we upgrade? As a rookie the team blog has be very helpful!

Thanks,

Mike

# February 19, 2008 11:40 AM

infopath said:

Hi Mike,

To be honest, I think this is new functionality to 3.0. I don't have a 2.0 server to test at the moment...do you have the Contact Selector (may be called the People Picker) control in 2.0?

Scott

# February 19, 2008 11:56 AM

mmattson said:

Hi Scott,

Thanks for the reply. We are using InfoPath 2007. I was able to set up the Contact Selector Control, but it doesn't look like the custom data connection using context.xml file is working. In SharePoint 2.0 I don't see a people picker control. Although, I can create a lookup field that pulls user information using the built-in functions. I have a SharePoint 3.0 server setup in the lab I'll see if it works there...

Thanks,

Mike

# February 19, 2008 12:55 PM

elielizondo21 said:

I've followed all the steps listed and the contact selector just displays Search Failed each time.  What else could I be doing wrong?

Are there any reasons known why the search would fail?

Thanks,

Liz

# February 20, 2008 11:51 AM

infopath said:

Hi Liz,

Where does it show the Search Failed? Also - you will want to make sure this works directly from SharePoint. Try these steps:

- Create a new document library for Word

- Add a new column to this library as a Person or Group column

- Create a new document by clicking the New button and just save this to the library

- Select the saved document and from the dropdown choose Edit Properties

- You should now see the Person column you created - perform the same search you did using the Contact Selector control...what is the result?

If it is still Search Failed then this is an issue with SharePoint and I don't have enough knowledge in SharePoint to troubleshoot that issue.

If it works - then did you specify the correct site URL in the Context.xml file?

Scott

# February 20, 2008 12:21 PM

maldrak said:

I'm getting the same error as anca_accenture.  I have an infopath form serving as a workflow modification form.  When I try to enter anything on the people picker, it pops up with "There has been an error while processing the form."  Checking the logs, it has "Exception Message: 'my' is an undeclared namespace. Line 1, position 2."

This form is also the association and initiation form.  It works normally in both those cases.  It is only as a modification form that it causes this error.  Any ideas?

# February 20, 2008 3:02 PM

infopath said:

Hi maldrak,

Unfortunately I don't know what would be causing this behavior. I never tested these steps with workflow forms so you may want to post this question to a workflow forum or contact Product Support (for Office Workflow) for assistance.

Scott

# February 21, 2008 4:16 PM

Arakazu said:

Hello, I am Ara.

I am trying to use the contact Selector AcitveX control on browser enabled Infopath form.

I followed your steps, and pulished it to a form library on MOSS2007 wich "Enable this form to be filled out by using a browser" cheked. The I can't open the form from the form library on SharePoint. Error says "Unknow error".

Do you have any tips???

Please help me.

# February 27, 2008 3:28 AM

infopath said:

Hi Ara,

Are you able to successfully publish an InfoPath Form Template with, say, just a text box and open it in the browser? I would not think this is being caused by the Contact Selector control.

Scott

# February 27, 2008 7:44 AM

Arakazu said:

Hello Scott,

Yes, I can publish this form to form library successfully. And if I delete the contact selector control, I can open my form from sharepoint.

Thank you for your help.

Ara

# February 27, 2008 11:11 PM

infopath said:

Hi Ara,

Have you followed the steps in this post exactly or are you creating your XSN from an external source (i.e. a schema file, database, etc.)?

Not that it should not work but I have not experienced this issue when following the steps in this post.

If you have indeed followed these exactly, please reproduce the error again and take a look at the SharePoint ULS logs to see if there is anything in there regarding the loading of your form. (NOTE: You may need to enable "Verbose logging" for the various Forms Services categories.)

Scott

# February 28, 2008 8:25 AM

LISpeedyG said:

Hi Scott,

You folks really seem to have a great handle on InfoPath, Great example!

I have a couple of questions on a similar topic.  And if you could find your way to answering, it would be appreciated:

Background: Infopath 2007 (Browser enabled), Main Data + 2 Sharepoint Lists as secondary data connections, Submitted to Sharepoint 2007 Forms Library and Email

1. I  have a DropDown List Box that is bound to one of the secondary SP List connections returning CoNames (approx 1600 in list).  This was used since I have not been able to find a search function that returns only a subset of the list names.  The list names are resolved rhatehr quickly and I can see all 1600 names in the drop-down.  However, once I select a name from the list Explorer usually gives a message that the "A script on this page is causing Internet Explorer to run slowly."  I am guessing that the large number of data is causing this message to appear.  I have checked off "never" on the Post back settings but it does not seem to have helped at all.  Additionally, once I have chosen a CoName several other text boxes are then assoriated to the CoName record, i.e., CoEmail etc..  And, as I tab across other fields I continue to get the same pop-up concernign the script activity.

So, the questions for this:  a) Are there any other methods to serch a SP field (using wild cards) would be extreemly helpful. b) Is there a way to speed up the forms lookup process so that we do not get the pop-up displayed?

2.  Once the form is filled out by the sending company with the above information it is then to be sent to the receiving company by email in order for them to continue filling out the remainder of the form.  So, I need to permanently "paste" the information retreived from the SP list into the form so that the receiving company cannot change it.  But the receiving company will fill out other parts of the form that relate to their activity on the topic.  Note that the receiving company is not to have access to the SP list but only the form.

The questions here are: a) The form currently attached to the email curently requires UserName and Password to continue filling out the form.  Since, apparently the sencondary data connections are still active once the email is received by the receivign company.  Is there a way to "paste" the chosen company specifics so that the form does not need to be connected to the DB?

b) Is ther a way to enable the form to be filled out by companies not using Outlook 2007?

I know these are not simple questions.  But the real world applications are also not usually simple.  Any help would be appreciated.

Thank You,

Gus

# February 28, 2008 12:04 PM

infopath said:

Hi Gus,

In the future, please keep questions and comments specific to the post.

1A: You would need to either write code behind InfoPath so you can send a custom CAML query or you can create a custom web service that uses a CAML query to return what you need - this way you don't need code behind InfoPath.

1B: Don't return this many records - see 1A! :)

2A: Make sure your data connections are not set to get the data when the form loads or you can look at caching the results for offline use. (Tools - Form Options - Offline.)

2B: No - unless you use a browser form - then they would need access to the site where you are hosting the form.

Like you have said, these are really not simple questions but I have provided "simple" answers. In reality, these will probably be more involved. You may want to poke around the InfoPath Newsgroups and see what others are doing or create a support incident where you can review this with an InfoPath Support Engineer.

Scott

# February 28, 2008 5:47 PM

LISpeedyG said:

Hi Scott,

Thanks for the reply..  I am sorry for posting here, but it looked (at least to me) like similar topic.  Anyway, in the future I will try to find a closer fit.

Thanks Again,

Gus

# February 29, 2008 12:10 PM

peterxwang said:

does this ContactSelector activex works on browser-enabled InfoPath form?

Thanks,

John

# March 5, 2008 10:19 AM

infopath said:

Hi John,

Yes - what you will probably have to do is set the Comptibility of your XSN to just InfoPath, add the Contact Selector control and then reset the Compatibility back to InfoPath and Forms Services.

Scott

# March 5, 2008 10:36 AM

jborean said:

Hi Scott,

I am having a couple of problems.

I followed every detail and when I tried searching for name it would pull up the names relevent to the search but then after selecting it the selector just goes inactive/blank.

When I tried entering a name and checking it... it just goes inactive/blank.

I started over, step by step, and noticed Step 3 "Drag the gpContactSelector Group to the View and select “Contact Selector” from the list of controls". When I try that there is no option for selecting the Contact Selector.

I am trying to set up a form that will be used as you stated "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." So after the Supervisor is selected a email or task can be assigned.

I am further hoping that the content of the selector can be referenced to assign a user role to grant access to conditional controls. And to send the user to a column in a SharePoint.

Your help will be much appreciated.

Best Regards,

Jason

# April 1, 2008 4:42 AM

jborean said:

Plus on Step 4 of Step 4 it says "

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

I do not see this option. There is however an "Automatically retrieve data when form is open" Option and you can select resource files and browse to the Context.xml file to include it in the template on the first screen for adding a Data Connection.

V/R,

Jason

# April 1, 2008 6:00 AM

infopath said:

Hi Jason,

The first thing I would suggest you verify is that the spelling/capitalization is correct in the data source for the Contact Selector control.

Also - make sure the URL you reference in the XML file is valid for your site.

Regarding your reference to step #4 - the steps you describe are correct: browse for the XML file and then make sure it gets included as a resource file.

Scott

# April 1, 2008 8:30 AM

jborean said:

Hi Scott,

I had the following wrong:

AccountId was AccountID

and the binding was set to Person instead of gpContactSelector

The option to select the Contact Selector resolved itself when the above were fixed.

I am still having a challenge getting the form to reference the user selected for a user role. I am trying the 3 different values: DisplayName, AccountId and AccountType. We'll see what happens... AccountId WORKED!

Thanks... now all I need to do is figure out how to get the Army to give me a raise... lol!

# April 1, 2008 10:26 AM

infopath said:

Hi Jason,

That is great to hear - congratulations!

Scott

# April 1, 2008 7:41 PM

cgarcia said:

Great article, thank you!

I was able to get the Contact Selector working perfectly by following these steps.

My problem is that I got the CS control working fine on the first form. I tried applying it to another (blank) form and got the "Search Failed" error when I click the "Go" button (this is after I've published to the SharePoint forms library). The control only works for the form where I first established it. The CS control is now available in the list of controls on my InfoPath client but fail when implemented (even when I set up the same data connection and Context.xml file as the first form). I'm not trying to tempate the control, just use it on a completly different form.

Any ideas?

I tried to read through all of the comments first, but I apologize if this question has already been asked. Thanks.

cg

# April 4, 2008 5:16 PM

infopath said:

Hi cgarcia,

The first thing I would check is your data source in the new form. Make sure the structure is correct and the node names EXACTLY match what I have in this post...including capitalization.

Scott

# April 4, 2008 5:44 PM

VSTO みちしるべ ~道標~ said:

トピック、バラバラ(?)ですみません。 ブログのツールのエラーで、なかなかアップできなくて、情報提供に少し焦っています。 なので、InfoPath ネタという訳ではないのですが。。。 &#160; でも、InfoPath

# April 16, 2008 8:54 AM

Martin.Kearn@Microsoft.com said:

Hi there,

I have followed these steps to add the activeX control to my form, however whenever I try to resolve a name (either via searching or using the check name button), the whole control gets greyed out.

When I use the search option, the search dialog does return a list of names as you'd expect but when I add a name and click OK, it gets greyed out.

Do you have any idea what is causing this and how I can fix it.

Regards - Martin Kearn

# April 29, 2008 5:49 AM

infopath said:

Hi Martin,

Please verify the following:

- The data source is designed exactly as I have in this post

- The capitalization of the node names is exactly as I have in this post

Scott

# April 29, 2008 8:44 AM

jagra said:

Thanks for the great article and all explanations after it.

I have a problem with this control: after a task is completed, if you open the task to review what was done, the information entered on contact selector fields (one or many) is lost. Is there a simple way to get it back and display it?

# May 6, 2008 1:02 PM

infopath said:

Hi jagra,

Some questions: does it retain the selected user(s) if you follow what is in this sample? If so (as it does for me) then how have you implemented the control?

Scott

# May 6, 2008 3:18 PM

FourthMusketeer said:

Hi Scott.

This blog has been very helpful.  By reviewing the information here I been able to add the Contact Selector control to my form, and also set up a second instance of the control on the form.  All is working great!

Now I would like to filter / restrict the selections to AccountType=User.  Right now it is possible to select security groups and distribution lists, either by browsing from the finder or by typing it in directly.  I want to prevent that and display some type of appropriate message to the users.

I'm not a programmer, so my ability to get too custom with code is somewhat limited.  However, any thoughts or suggestions you might have would be greatly appreciated.

Thanks,

FourthMusketeer

# May 27, 2008 2:01 PM

FourthMusketeer said:

Scott,

I forgot to mention that I am using the browser to render the form, not the InfoPath client.

4th

# May 27, 2008 2:12 PM

infopath said:

Hi FourthMusketeer,

I have been trying to develop sample code for this (there is no way to do this via the control, UI, etc.) but unfortunately I have not been successful in getting this to work.

If I ever find a solution, I will be sure to post it here.

Scott

# May 28, 2008 11:47 AM

k_luckyreddy said:

Hi Scott,

I am getting search failed error when I serach for a contact in Contact selector. User or person field works in my sharepoint site.

I followed all the steps. I rechecked Spellings and Captilization.

Should I publish the form to sharepoint for the contact selector to work.

Any help is appreciated...

Thanks

# May 29, 2008 1:32 PM

infopath said:

Hi k_luckyreddy,

You should not have to publish the form template (XSN) for the Contact Selector control to work; however, for troubleshooting purposes this may be a good test.

If the Contact Selector control still fails when being opened in the browser, check the server Application Event log and see if any errors around this issue are being written to the log.

Scott

# May 30, 2008 9:03 AM

晃晃悠悠 said:

Q:为什么InfoPathForm作为TaskForm的时候,可以通过SPWorkflowTaskProperty.ExtendedProperties属性(一个哈希表)直接获得InfoPath...

# June 1, 2008 1:03 AM

jagra said:

Greetings,

Refering to a post on May 6, the contact picker shows only the first choice when someone opens the form after the first submit (on workflow task history). That is done by defining the default value = ItemMetadata/ows_accountId.

When more then one person ou group is selected, the data is correctly sent to workflow but opening infopath form only shows the first user.

Maybe we are doing something wrong :(

Can you post an example of an ItemMetadata that works for multiple values in a ContactPicker?

# June 3, 2008 6:04 AM

infopath said:

Hi jagra,

I am not sure I follow - can you successfully show multiple values (separate by a semi-colon) if you just open an InfoPath form with the Contact Selector control?

Workflow issues are handled by a different team so I am not sure how you are getting this information to the Contact Selector control but as a test, I can successfully open an InfoPath form with the Contact Selector control, enter 2 names (again, separated by a semi-colcon), resolve those names and save it in the underlying XML.

So maybe the question would be: is the InfoPath form being "saved"? If not, I am assuming you are reading the values from the ItemMetaData? If so, how is this being done?

Scott

# June 10, 2008 8:23 AM

stephorn said:

Hello,

I am having some problems with what I thought would be a very simple application for the Contact Selector control.

We have a MOSS Forms Library and on our form we would like for the person to be able to select whom to e-mail this form to.

So, we have created the Contact Selector as described above.  Then we added a data connection to e-mail those people selected in the Contact Selector.

The problem we are seeing is that when we select the Display Name - it attempts to send two e-mails one for the first name and the other for the last name.

Then we switched to AccountID and that is sending an e-mail to username\domain@domain.com.

Is there a way to use the Contact Selector to accomplish this task?  

We have been looking at how to strip the \domain from the AccountID setting but don't know how to do that.

Any Thoughts?

Thanks for all the useful information,

Andy

# June 12, 2008 10:14 AM

infopath said:

Hi Andy,

As you have probably seen, the user's "e-mail" address is not one of the pieces of data that is returned by the Contact Selector control. However, you can achieve what you want using a couple of string manipulation functions: "concat" and "substring-after".

Here are the sample steps:

- Modify your e-mail submit connection

- Click the "fx" button next to the "To" field

- Basically what you need is the user id after the "\" from the AccountId field. So to get this you would use the "substring-after" function.

    - Click Insert Function

    - Select the Text category

    - Double-click "substring-after"

    - Double-click the first argument to this function and select the "AccountId" node for the Contact Selector and click OK

    - Select the second argument to this function and replace it with this: "\"

- At this point, you should have this: substring-after(AccountId, "\") What you need to do now is simply use the "concat" function to concatenate this with your e-mail domain

    - Place your cursor at the front of the current expression and enter this: concat(

    - Place your cursor at the very end of your expression and add this: , "@yourdomain.com")

- Now your complete expression would look like this:

concat(substring-after(AccountId, "\"), "@yourdomain.com")

(NOTE: You will need to replace "yourdomain.com" with the appropriate e-mail domain for you.)

- Click OK to get you back to the Data Connection Wizard

I hope this helps!

Scott

# June 16, 2008 8:44 AM

mehtavipulk said:

Hi Scott,

With reference to the post dated "10-Apr-2007" (regarding restricting Contact Selector control for user to select only 1 user), I have implemented the code given there but for the 1st time when i enter more than 1 user, the control gives the error (by marking the control RED). But when I remove all the users except 1, the control still persists with there error message.

But when I remove all the users & then enter a single user, it works fine.

Is there any modification that I need to make in that code?

Regards,

Vipul Mehta

# June 19, 2008 9:21 AM

infopath said:

Hi Vipul,

After you remove the users, you need to validate the control again (i.e. click the Check Names button.) Just removing the additional names from the control itself does not actually remove them from the "Person" repeating node.

To see this, temporarily drag the "Person" repeating node to your View as a Repeating Section with controls. Add your names and verify - result: you will see the added repeating sections. Now, just remove the additional names from the control - result: the repeating sections with those users are still there until you validate the names again.

Scott

# June 23, 2008 8:43 AM

Yannis-C said:

Hello,

I'm encountering an issue when in the same form view I have the contact selector as well as a currency field with data format 'euro Dutch (Belgium)'.

When I fill in my currency field, I get the american format (10,000.50) instead of the desired Dutch Belgium format (10.000,50). When I refresh the form or change view and return back, the format is updated to the Dutch one.

Does anyone know how to edit the locale for the contact selector control or any other workaround?

I'v already set the locale to Dutch in the site's regional settings, the form language and the currency field.

Thank you in advance.

Yannis-C

# August 5, 2008 10:21 AM

SubbuZ said:

Scott,

I wondering how come no one had asked this question so far on the 'siteUrl' in the Context.xml?

I have an InfoPath form designed to be used from InfoPath client. I've designed this form in a development environment. So the Context.xml contains the URL for development site collection.

Now I'd like to package the InfoPath form to be deployed in multiple Farms (Staging, Testing, Production). I've Data Connection library to take care of all other secondary connections. For Context.xml, I coould not create a I would like deduce the 'siteUrl' in the Context.xml on the fly based on the site collection to which it is being deployed. Is there way to do it.

Thanks,

Subbu

# August 7, 2008 1:41 PM

infopath said:

Hi Subbu,

The only way I know of to do this would be to write code on the Loading event of the XSN that updates this value in that XML Resource File. Keep in mind, dynamic updates to Resource files do not persist once the form is closed so this code would need to run each time the form is opened.  Which of course means you would need to know this URL when you deploy those XSN files.

Scott

# August 7, 2008 3:20 PM

Will Dieterich said:

Here is a solution if you want to limit the list of names to a group of people and only allow one selection.  This has limited uses but if you just need the email of a person so you can send email to them from a sharepoint workflow this does it.

First dump contact selector, use drop down list instead.  This makes it easy to limit to a single person.

1) Create a sharepoint custom list, add 2 columns  for the persons.  First one a name(with presence) the second set the Show Field to Work Email.  Fill in person for the name and email.  Most of the time where you are limiting the list of people some office is doing it and a simple note reminds them to duplicate the information; or have a workflow do it.

2) Create a data connection using the retreive info from list.  Make sure to select the two columns you created.

3) Create a drop down list and link the new data source to it showing the name and the value as your email address.  

4) Publish and make available the column.

You can now use that column in sharepoint workflow as an email address.

# August 11, 2008 6:43 AM

Will Dieterich said:

Here is a solution if you want to limit the list of names to a group of people and only allow one selection.  This has limited uses but if you just need the email of a person so you can send email to them from a sharepoint workflow this does it.

First dump contact selector, use drop down list instead.  This makes it easy to limit to a single person.

1) Create a sharepoint custom list, add 2 columns  for the persons.  First one a name(with presence) the second set the Show Field to Work Email.  Fill in person for the name and email.  Most of the time where you are limiting the list of people some office is doing it and a simple note reminds them to duplicate the information; or have a workflow do it.

2) Create a data connection using the retreive info from list.  Make sure to select the two columns you created.

3) Create a drop down list and link the new data source to it showing the name and the value as your email address.  

4) Publish and make available the column.

You can now use that column in a sharepoint workflow as an email address.

# August 11, 2008 6:43 AM

star12 said:

Hi Scott,

Very informative article! Thanks for sharing.

What you outlined works great, when I tried. My requirement is to be able to select email id in the submit form, just like having the contact selector once the form is submitted. The idea is to allow the applicant to direct the form to the appropriate approver.

Is there a way to do this?

Thanks

FK

# August 16, 2008 12:09 AM

infopath said:

Hi FK,

As you have probably seen, the user's e-mail address is not one of the pieces of information returned by the Contact Selector control. You can either use the UserProfileService.asmx web service (if you have profiles setup in your  database) or take a look at my reply on 6/16 on how you can do this by parsing the information returned by the Contact Selector control.

Scott

# August 18, 2008 9:00 AM

star12 said:

Scott

Thanks for your reply. But I am not able to use contact selector control itself in the submission part of the form. To let you know, I am fairly new to Infopath and may be contact selector is not the answer to my problem.

What I am trying to do is allow the user to select to whom the form must be submitted(via email). And I was trying to use the contact selector to select the email id in submission, but with fail.

Is there any other way to do this?

Thanks

FK

# August 19, 2008 10:41 AM

infopath said:

Hi FK,

Here is what I am referring to:

- I am assuming you have a Contact Selector control on your form template

- As you have seen, this does not return the e-mail address of the user (there is no way to get that specific piece of informtion from the contact selector control.) However, once you select a user, one of the nodes that does get populated is the AccoundId node from the Contact Selector control. You can parse the information in this node to create the e-mail address...assuming you know the domain where the mail needs to go (i.e. fk@somemail.com)

Scott

# August 19, 2008 11:15 AM

star12 said:

Got you . Works great now. Thanks for your quick response!

# August 20, 2008 6:16 PM

jjackson999 said:

Hi, i have tried to create  the Contact Selector Control but when i load the infopath form in IE it doesnt do anything ? I must be doing something wrong somewhere. can you help me ???

Thanks

JJ

# August 21, 2008 3:13 PM

jjackson999 said:

Hi Scott,

Please see below some more detail (same problem as someone else)

I have checked the logs but no joy ?

I am getting search failed error when I serach for a contact in Contact selector. User or person field works in my sharepoint site.

I followed all the steps. I rechecked Spellings and Captilization.

The only thng I can think of is that the server name is incorrect (i tried the SP server and the domain controller )

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

**NOTE: Replace <servername> with the name of your server

Any help is appreciated...

# August 21, 2008 3:24 PM

infopath said:

Hi jj,

The server that you enter in the context file should not really come into play if you are displaying the forms in the browser.

I am wondering if there is some type of permissions issue possibly occurring? I would suggest you start with a Netmon trace and see if this shows where it is failing. If not - you will probably need to open a support case so we can dig into this further for you.

Here is the download site for Netmon:

http://www.microsoft.com/downloads/details.aspx?FamilyID=18b1d59d-f4d8-4213-8d17-2f6dde7d7aac&DisplayLang=en

Scott

# August 22, 2008 11:21 AM

mehtavipulk said:

Hi,

I have a Contact Selector control on my InfoPath form. In the AD I have 3 accounts mydomain\user1, mydomain\user2 & mydomain\user3. The name of all the 3 users are Test User. I have a DL "My Users" which has all the above 3 users added to it. I then added this DL to my share point site with "Full Control" permission. Using the contact selector search box when I try to search for "Test User", I do not see any records filter. But when I explicitly add the above 3 accounts to the share point site & then filter using contact Search Box, I see all the above 3 accounts listed.

Before adding the above 3 accounts to the share point site, when I check the account name (by clicking the "Check Name" button on the right side of the control) the contact selector control successfully validated it against AD.

It seems that Contact Selector look up box is filters the users from the people list of the share point site.

Can any body tell me where does the look up box filters the account from? AD OR People List of the Share point site?

Regards,

Vipul Mehta

# August 25, 2008 5:14 AM

infopath said:

Hi Vipul,

Can you see if the same behavior occurs with the SharePoint People Picker control? To test this, navigate in SharePoint to a Permissions page where you can add a user or group. When you enter a user's name or a group (as you are trying to do) this is using the People Picker control - does the same behavior occur here?

Thanks,

Scott

# August 25, 2008 8:12 AM

amit4691 said:

Hi Scott,

I am having some issues with "Contact Selector Control" on multiple Infopath forms. I am using Infopath forms along with SharePoint workflow process. I have two Infopath forms; in the first form known as InitForm I added two "Contact Selector Controls" in which workflow-initiator will specify two participants for the workflow in the begining. In the second form known as RevForm, I added another two "Contact Selector Controls" in which workflow task-owner will specify two more task-owners on the fly. The second form will work as a modification form for the workflow.

Now, the problem started with "Person" object when I converted both the forms into C# classes using xsd. I had to convert them into C# classes so that I could access them in the run time (I am using XML serialization/deserialization in the run time). Both the classes are in the same assembly, the compiler didn't like "Person" object twice. I tried with different name for "Person" in one of the Infopath forms. Somehow "Contact Selector Control" did not like any other name for "Person" object.

What is the best approach in order to use Contact Selector Control on multiple forms? How can I access the data in the run time? I really appreciate if you could provide some advice in this regard.    

thanks

amit

# August 25, 2008 10:41 PM

mehtavipulk said:

Hi Scott,

I tried the above steps with Share Point people picker (PP) & that too behaved in the same manner. The  PP successfully validated the account name but did not filtered it using the search box. Only after adding the account to the people list, the search box filtered out the account(s)

Is there any other control in InfoPath 2007 very similar to Contact Selector?

Thanks,

Vipul Mehta

# August 26, 2008 2:49 AM

infopath said:

Hi Vipul,

If the SharePoint People Picker behaves the same way then this is not an issue with the Contact Selector control per sé and you would be best served to either post this query in a SharePoint blog or possibly even open a support incident with the SharePoint group to investigate this behavior. I am not a SharePoint expert so I won't begin to guess <g> if this is expected or not, can it be changed, etc.

Amit - I have never tried converting to C# classes with multiple Contact Selector controls on one form - this may not be possible but I am not sure without further investigation. If you need this researched soon you would probably be best served to open a support incident to look into this further as I am not sure when I could do this. However, in the interim you may also want to post a query to a workflow blog to see if there is a way to get to the data without having to convert to C# classes.

Scott

# August 26, 2008 8:50 AM

Yannis-C said:

Hello Scott,

I’ve posted a month ago an issue I had in relation with the Contact Selector control which unfortunately I haven’t solved yet. So first of all accept my apologies for bothering you again with this. I’ll describe my problem a bit more accurately.

1. I have a web-enabled form with a currency field.

2. This currency field is of Data type: ‘Decimal (double)’, Format: ‘Currency’, ‘Dutch (Belgium)’ and with ‘Use a digit grouping symbol (.)’ checked.

3. When opening the form in a browser, the field works fine.

4. When adding the Contact Selector control to the form, things go bad, meaning that if I paste the following number ‘100.000.000,99’ in the field, I get an error message ‘Only numbers allowed’. (The same error message occurs also when you manually enter a number and then change one digit.).

This error happens only when opening the form in a web browser and with the control included the form.

If you have any idea how I can prevent this happening, I would be very grateful. This control is much too nice not to make use of it for such a ‘silly’ issue.

Thank you in advance.

Yannis Chaviaras

# September 5, 2008 11:39 AM

infopath said:

Hi Yannis,

It seems I can reproduce this without even having the Contact Selector control on the form template. At any rate, we need to look into this further and see if this is a potential issue. Please open a support case with Microsoft so we can dig into this properly and work with the Product Group on this should it be necessary.

Thanks,

Scott

# September 8, 2008 8:12 AM

Yannis-C said:

Hi Scott,

Thanks for you reply. A support case shall be opened asap.

Regards,

Yannis

# September 9, 2008 8:10 AM

richiej said:

Hi Scott,

great blog. Just wondered if you knew of a way to apply validation to contact selectors on a browser only form?

I have 3 CSs on my form and I want to ensure the user has entered people in each CS. So far all my playing about with the conditional formating has failed. Is there another way to achieve this?

Many thanks

# September 11, 2008 6:50 AM

infopath said:

Hi rishiej,

Thanks!

It is a bit challenging to "validate" whether or not a Contact Selector control has a value and here is why: the corresponding "Person" node does not get updated until you "validate" the name selected or entered in the control.  You can easily see this by adding the Person node as a Repeating Section with Controls and then enter a name in the Contact Selector...none of the nodes under Person get updated until you validate the user. And the reverse is also true - if you simply delete the name you entered, the Person node does not get removed until you "re-query" (validate) what you entered. So this makes creating a fool proof validation method difficult if not impossible.

Now, with that said, if you can "train" your users to always validate (click the Check Names button) their changes, then something like this will work:

Add 3 new nodes (datat type = Boolean) to the "myFields" node:

cs1Completed

cs2Completed

cs3Completed

Add Conditional Formatting (I am assuming to, say, a button - that was my test) that simply check if cs1Completed is equal to False or cs2Completed is equal to False or cs3Completed is equal to False then disable the button.

Now, you will need to code to toggle those "csxCompleted" nodes. To do this you will add the "Changed" event to each Contact Selector group (not the Person node but the parent group for each Person node.)

In each changed event, I have code like this:

if (e.Operation == XmlOperation.Insert || e.Operation == XmlOperation.ValueChange)

{

    SetBooleanNode(e.Site, "cs1Completed");

}

And this is my SetBooleanNode procedure:

private void SetBooleanNode(XPathNavigator xnCS, string strNodeName)

{

    XmlNamespaceManager ns = this.NamespaceManager;

    XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();

    XPathNavigator xnBoolean = xnDoc.SelectSingleNode("/my:myFields/my:" + strNodeName, ns);

    if (xnCS.SelectChildren(XPathNodeType.Element).Count == 0 || xnCS.SelectSingleNode("my:Person/my:AccountId", ns).Value == string.Empty)

         xnBoolean.SetValue("false");

    else

         xnBoolean.SetValue("true");

}

The reason we need to check the node count is if the user clears their entry and then clicks the Check Name button (which we want them to do <G>) then the entire Person node is removed.

In my testing this appears to provide what you need; however, this is entirely contingent upon the user validating the name they entered or selected...even if the value is blank.

I hope this helps!

Scott

# September 11, 2008 8:55 AM

richiej said:

Thanks Scott, works a treat (not fool proof but certainly the best way)

thanks again

# September 11, 2008 10:24 AM

BlueChan said:

Hi Scott,

I've just tried to print an infopath form with the contact selector control on it. But the contact selector doesn't print. Any suggestions?

# September 15, 2008 1:39 AM

infopath said:

Hi BlueChan,

The information you see in the Contact Selector control is actually stored in the three nodes below the "Person" repeating group - not the "box" you actually see on the Contact Selector. (You can see this by simply dragging the "Person" node to your View as a Repeating Section with Controls and Preview the form. Simply typing a name in the Contact Selector control does not populate anything until you "validate" the name you entered.) To achieve what you want you will need to create a separate "printing" view (simply a View for printing) and instead of using the Contact Selector control on this view you will use either the "AccountId" or "DisplayName" node to show the selected user.

I hope this helps!

Scott

# September 15, 2008 7:33 AM

.Net said:

Using the Contact Selector Control

# September 23, 2008 7:24 AM

simonliu said:

Hello Scott,

I am having some problems about Contact Selector control.

We have a MOSS Forms Library and on our form we would like for the person to be able to select whom to e-mail this form to.

So, we have created the Contact Selector as described above.  Then we added a data connection to e-mail those people selected in the Contact Selector.

The problem we are seeing is that when we select multiple users, how can we get  emails form AD for those users?

In our AD, user account ID has no relationship with user's email address,  For example, we select two users (John Smith and Tom Smith) John Smith'e email is: johnd@hotmail.com and Tom Smith email is tomsmith@gmail.com.

Any Thoughts?

Thanks for all the useful information,

Simon Liu

# September 23, 2008 4:29 PM

simonliu said:

Hello Scott,

I am having some problems about Contact Selector control.

We have a MOSS Forms Library and on our form we would like for the person to be able to select whom to e-mail this form to.

So, we have created the Contact Selector as described above.  Then we added a data connection to e-mail those people selected in the Contact Selector.

The problem we are seeing is that when we select multiple users, how can we get  emails form AD for those users?

In our AD, user account ID has no relationship with user's email address,  For example, we select two users (John Smith and Tom Smith) John Smith'e email is: johnd@hotmail.com and Tom Smith email is tomsmith@gmail.com.

Any Thoughts?

Thanks for all the useful information,

Simon Liu

# September 23, 2008 4:30 PM

sebastian54 said:

Hello Scott,

This post has been quiet helpful in implementing the CS control in my forms, then with using multiple controls on forms, etc.

One question which I have yet to get a definitive answer to is whether there is a way to promote the CS field from a form to a person or group column in MOSS.

I can promote as simple text, but I would like to do it so there we have presence and a hyperlink (ideally without code).

Is there just no way of doing this?

Thanks,

Sebastian

# September 30, 2008 10:44 AM

infopath said:

Hi Sebastian,

The only way I know of is to use code because there is no mechanism to promote to a "Person/Group" field from within InfoPath.

Scott

# September 30, 2008 11:18 AM

Nick Gerold said:

Hi Scott!

Great article!

I'm newby in IP, so, I've a problem (

I've got an SP workflow and my Instantiation form with Contact Selector Control. I need to assigne task to the user selected from the contact selector.  But I don't know how to do it. What value I should whrite in "taskProperties.AssignedTo"?

I know there are 2 ways: 1. Use x-paths, 2. Convert form to C# classes using xsd.  But I still don't know what value(DisplayName/AccountID/AccountType) i should use to assign task correctly.

I need help.

Thanks for all pieces of advice

Nick

# October 1, 2008 12:34 AM

infopath said:

Hi Nick,

I am not a workflow expert so I don't know that I will be able to help with this question - you may be better served posting to a SharePoint or Workflow blog to get the best advice.

Now, with that said, here in InfoPath the question we get a lot is how to "promote" the user selected in the Contact Selector control to a "Person/Group" field in SharePoint. This is not possible out of the box and requires code - so...why am I telling you this? <g> In order to get this process to even work using code, I have to get the "SharePoint ID" of the selected user and pass this to the Person/Group field. So in the end, this *may* be what you need to do as well; however, I would encourage you to not spend much time on my suggestion as I really don't know if this is the correct way to go. Post the same question to a SharePoint/Workflow blog to be sure you get the best advice.

Scott

# October 1, 2008 7:52 AM

Nick Gerold said:

Hi Scott!

Thanks for your reply (esp for so soon)!

Well, I found some, er, kind of solution of my problem , but... getting trouble whith Contact Selector Control. (

I'm starting to create a new workflow by myself (before this I changed existing one) and when I'm trying to open the form I have "unknow error" message.

It seems to me that I missed something important...

Well, I think, I should reread your great blog more cearfully.

Thanks again

Nick

# October 1, 2008 8:39 AM

infopath said:

Hi Nick,

No problem - what I would suggest though in your new workflow test is to take the Contact Selector control out of the picture. Create the workflow without this control and make sure you can launch the form.

Scott

# October 1, 2008 9:08 AM

brad.covell said:

How do I add two contact selector controls to the same form? I tried adding a second one but when I create the data for it mainly the groups and fields, it says the name of the group already exists. So I cannot name the group Person again or have fields named DisplayName....

Is this possible to do?

Thanks

# October 1, 2008 11:58 AM

infopath said:

Hi Brad,

Take a look at the May 22nd comment...this provides the steps.

Scott

# October 1, 2008 12:35 PM

BlueChan said:

Scott,

I want to enter the text from the Contact selector text field into the search box that appears when you click the "To..." button. Is this possible?

# October 2, 2008 2:51 AM

sebastian54 said:

I just figured out a way to promote to a person or group field.  It only supports single values, but it will work.  Simply create to columns one text, the other a person or group.  Promote the "AccountId" to the text column, then with a simple SharePoint Designer workflow update the value in the person or group column to equal the value in the text column.  

Sebastian

# October 2, 2008 8:28 AM

Nick Gerold said:

Hi Scott!

Thanks!

Well... Whithout Contact Selector my workflow works like a charm. So, now I'm trying to deploy a solution whithout this, using advice about mails and data sourses from your blog (thanks that guy how shared it, too). But it is temporary decision and I guess I'll return to Contact Selector later ( .

It is not scary for me to use code and in your reply about "SharePoint ID" I see a way.

Thanks again,

Nick

# October 2, 2008 11:39 PM

infopath said:

BlueChan,

Unfortunately I don't know of any way to accomplish this - sorry.

Nick - glad to hear you are making progress...so the question now would be: since you have a working workflow, what happens if you add the Contact Selector control? If it then produces an error, turn on Verbose Logging (Central Admin | Operations | Diagnostic Logging) for the various Forms Services categories and see if anything is logged that would provide additional details as to what is failing.

Scott

# October 3, 2008 8:05 AM

ClaytonCobb said:

I have added this new control, but my form will not render in the browser if the control is added to the form.  If I remove the control from the form surface itself, then the form will render, but once I add it, I get a strange "Unknown Error" in the browser...the form never even opens, and the "Loading Form" image stays in view, which I've never seen before.  All other errors I've seen with InfoPath actually showed themselves from the Forms Services interface, but this is an error shown in the browser itself (looks the same as when you get an access denied error).

I get nothing in my logs and have no idea what is occurring.  When I test it in preview mode (I did add the XML file as a secondary data source), I am able to click "To" and search for names (this works), but when I click Add > Ok, my control grays out and shows no information in the box.  I have checked over the data structure syntax, and it looks correct.  The fact that it will retrieve users in the "To" interface tells me I did part of it right, but I can't make heads or tails of the other errors.

# October 6, 2008 2:49 PM

infopath said:

Hi ClaytonCobb,

The first thing I would suggest is to try a completely new form using only the steps I provided in this blog. NOTE: Make sure that field names and *capitalization* match what I have here. If this does not work and you still get the Unknown Error page then try these steps:

1) Navigate to your Central Admin site

2) Select the Operations tab

3) In the Logging and Reporting section click Diagnostic Logging

4) In the Event Throttling section, click the "Select a category" dropdown box

5) Select the "All" category

6) In the dropdown below the title "Least critical event to report to the trace log" choose Verbose (note this is not for the event log - only for the trace log)

7) Click OK

8) In the "Trace log" section make a note of the path to the log files

9) Navigate to your site and complete the steps to recreate the error

10) Navigate to the log files folder, click the "Date Modified" column header twice (to sort them with the latest log at the top) and open the newest log with a text editor, i.e. Notepad.

11) Scroll to the bottom and work your way back up and see if there is anything logged that would help isolate the problem.

Scott

# October 7, 2008 8:16 AM

ClaytonCobb said:

Scott, I did exactly what you suggested on #1 by creating a new, blank form that has nothing except the steps in this blog entry, and I get the exact same errors.  I already have my diagnostic logging turned on but may not have it set to verbose, so I'll go check.

# October 7, 2008 12:59 PM

ClaytonCobb said:

Don't see any errors in the trace log, but I also notice that my Diagnostic Logging settings keep reverting back to null.  Is that normal?  I set to All/-/Verbose, hit OK, it takes me back to the Operations page, then I click on Diagnostic Logging, and all the pulldowns are set back to null.

# October 7, 2008 1:16 PM

ClaytonCobb said:

Sorry for the multiple posts, but I have a set of screenshots showing:

1) The strange browser error when trying to open a new browser-enabled form with the Contact Selector (rest of form is blank)

2) Design mode of the form that confirms the spelling and setup of the data elements - shows the items tab on the properties of the Contact Selector control

3) Shot showing the form in Preview mode (rich client) and how the To: button works and can retrieve my name from AD

4) Shot showing the form in Preview mode after selecting my name and hitting OK

How can I post this?  I have them as 4 images in a zip file that is less than a Meg.

# October 7, 2008 1:46 PM

infopath said:

Hi ClaytonCobb,

Try this for me:

- Navigate to the same site where you are trying to use this form template

- Create a new library (this is just for this test so what you call it is not important and you can just create a Document library)

- From the Settings button choose Document Library Settings

- Click Permissions for this document library

- From the Actions button choose Edit Permissions

- Click OK to the message

- Click the New button

- Enter a users name in the "Users/Groups" box and click the "Check Names" button...does this work?

Scott

# October 7, 2008 3:17 PM

ClaytonCobb said:

Yeah, my people pickers work everywhere, so that doesn't seem to be a problem, but I have new info that should really lead me to a solution, but it hasn't yet.

I had a friend at MS send me a working form that already has this same Contact Selector added, and when I use his form, the Contact Selector works perfectly both in rich-client and browser form.  I just had to change the resource file and a few other things, but when I published it to the SAME library as my previous form, it rendered in the browser perfectly like you would expect.  I have been viewing each form side-by-side and cannot see any anomalies except that his form had the data elements inside the Person group set to "repeating," but yours aren't repeating in this blog.  I changed mine to match, but the behavior didn't change, so I don't believe that's an issue.

# October 7, 2008 6:13 PM

infopath said:

Hi ClaytonCobb,

That is indeed interesting information. If you would, navigate to: C:\Program Files\Microsoft Office\Office12, right-click on the "ContactPicker.dll" file and choose Properties - what is the Size, Version and Date Modified properties on your file?

Scott

# October 9, 2008 9:13 AM

cewe said:

Hi Scott,

   I have been trying to get the Contact Selector to work for 2 days now but it still would not work. I followed your steps exactly and repeatedly doing it to make sure I did not make any mistakes. However, when I tested my form, it always showed search failed. I am wondering that it may have to do with the server that URL that I used because I'm unsure of it.

http://servername/_vti_bin/UserProfileService.asmx.

Thank you

cewe

# October 16, 2008 5:51 PM

infopath said:

Hi cewe,

Try these steps please:

- Navigate to the same site where you are trying to use this form template with the Contact Selector control

- Create a new library (this is just for this test so what you call it is not important and you can just create a Document library)

- From the Settings button choose Document Library Settings

- Click Permissions for this document library

- From the Actions button choose Edit Permissions

- Click OK to the message

- Click the New button

- Enter a users name in the "Users/Groups" box and click the "Check Names" button...does this work?

Scott

# October 17, 2008 8:11 AM

cewe said:

Hi Scott,

   Yes, it works. Why do you want me to test this? Is it to test if the sharepoint's directory is working?

Thanks

cewe

# October 17, 2008 3:42 PM

infopath said:

Hi cewe,

Many times when I have seen the Contact Selector control display Search Failed that you will get the same error when using the People Picker control in SharePoint - so I wanted to see if this was isolated to the Contact Selector control or happened elsewhere as well.

What is the exact URL you used to publish the XSN?

Scott

# October 17, 2008 4:22 PM

melmo said:

Hi Scott

Thanks for a great post and very helpful comments.

I am using a contact selector in an Infopath form which will retrieve a users contact details when they enter their name. We do not store these details in AD, so this is a web service look up to another database.

I have entered some rules which are set in the data source on the group containing the Person repeating group.

These rules take the accountID from the contact selector and pass them into a query in the web service. It then populates several fields with the results of the query.

This works perfectly in Preview mode but does not work when the form is published to SharePoint  Forms Services.

It appears that when you enter a name and click the check button - the rules fire immediately - that is, before the name has been validated against AD and therefore before the AccountID is known.

Any ideas on how I can get these rules to fire only when the name has been vaildated?

Many thanks

# October 20, 2008 12:04 AM

infopath said:

Hi melmo,

I believe your best option to accomplish what you need would be to write code to execute what you want and when you want it to execute.

There is some sample code here in the comments for other issues - let me know if you need more help!

Scott

# October 21, 2008 2:13 PM

melmo said:

Thanks Scott

I was thinking code but that didn't seem as straightforward as I'd hoped. (http://www.infopathdev.com/forums/t/8156.aspx was helpful although they seem to be using a changed event rather than validating)

I have managed to get my rules firing correctly when they were placed on the AccountID data source. I had tried this about 6 wks ago - but the rules didn't fire in InfoPath preview so I never imagined they would fire in the browser!!

Obviously the contact selector behaves quite differently depending on whether you are using it in the native InfoPath or publishing to the web.

Mel

# October 21, 2008 4:39 PM

ginni said:

I have used SharePoint Designer in creating this workflow. I have used one infopath form and publised it to a SharePoint Library so that after filling it, users can submit. In this form , i have used a contact selector control named "Participants" so that user can write the name of participants.

I want mail should go to each and every participant (Whose names user write in Contact Selector Control). Well contact selector does have the functionality of sending the mails by reading the user's names and email addresses from active directory but it is sending only to the first person (among the names which i write in that control).

While publishing the form when we map Infopath fields to sharePoint library, there come some options when i click on "AccountId", options are "first", "last", "count", "merge".

When i click on first and publish the form then it sends mail only to the person whose name appears first on the contact selector control. If i selecet "last" then it sends mail only to the person whose name appears last on the contact selector control. On count it gives a integer value specifying the number of users in that control. When i use merge then it just merge all the names but does not send mail.

I am not getting how to send mails to all the participants. Its really very urgent. Plz help

Regards

Ginni

# October 22, 2008 12:56 AM

infopath said:

Hi Mel - glad to hear you have it working!

Hi Ginni...I may have an option for you but with these steps I am making an assumption: when you select a user in the Contact Selector control, the AccountId field would display that user as: domain\user.

Try these steps:

1) Add a new node to your data source named: emailList (you do not need to add this to your View unless you just want to, for testing purposes, see it is getting populated correctly.)

2) Right-click on the new "emailList" node and choose Properies

3) Click the "fx" button for the Default Value property

4) Click the Edit XPath check box to enable this option

5) Copy and paste this expression into the Formula box:

xdMath:Eval(xdMath:Eval(../my:group1/my:Person, 'concat(substring-after(my:AccountId, "\"), "; ")'), "..")

6) Click the Verify Formula button and assuming there are no errors, click OK until you are back to your View.

7) Add (or select) a couple of users in the Contact Selector control and if you added the "emailList" node to your View, you should see just those users in that box separated by a semi-colon

8) Use the "emailList" field as the "To" option for your e-mail submit data connection

NOTE: What the expression above is doing is getting each value in the "AccountId" field, parsing it to return just the name after the "\" (i.e. domain\user) and then concatenating a semi-colon after each entry. So in short, this is building a semi-colon delimited list of the user names you have selected, which can then be used for your e-mail data connection!

I hope this helps!

Scott

# October 22, 2008 10:03 AM

cewe said:

Hi Scott,

   Here is my exact XSN:

http://<servername>/test/Infopath Forms/Forms/template.xsn

Thank you

cewe

# October 22, 2008 7:03 PM

infopath said:

Hi cewe,

OK - I may have missed something in your previous post: where are you adding this URL: http://servername/_vti_bin/UserProfileService.asmx ?

Also - where are you seeing Search Failed? Is this when you click the "To" button and search for a name? Are you opening the form in the InfoPath client or in the browser?

It sounds like you entered that URL in the "Context.xml" file - if this is the case, then you need to modify that URL to either: http://servername or http://servername/site (if "test" is indeed a subsite.)

Scott

# October 23, 2008 9:20 AM

Giny said:

Thanks a lot Scott. Its working now but one issue is there. That above infopath code is assigning one extra task. I mean if i am entring names of 4 participants then on start of workflow, in workflow details, it shows the task assgined to respective users like :

AAA            Collecting Data

BBB            Collecting Data

CCC           Collecting Data

DDD           Collecting Data

                 Collecting Data

But it is assigning one extra task, without any name. I am not getting from where this extra task is comig where namefield is blank.(AAA, BBB are just names of participants)

Regards

Ginni

# October 31, 2008 4:57 AM

infopath said:

Hi Ginni,

I am not sure what code you are referring to? If this was specifically workflow code, you may need to post this issue in a workflow blog.

Scott

# October 31, 2008 10:00 AM

Rimpy said:

Hi Scott

I have not used any code, i am using sharePoint Designer. I have just wriiten that formula in the infopath form text box control which u gave me to send mail to multiple people through contact selector control.

That formula is working perfectly. It is sending mails to multiple people but creating one extra task as mentioned in my last comment.

When i don t use this formula, then it does not create extra task but also at the same time sends mail to only one single person.

Regards

Ginni

# October 31, 2008 11:20 PM

infopath said:

Hi Ginni,

I don't see how just adding that expression to a control would cause an additional (blank) task to be created. Do you have any code that creates those tasks? If so - how is that being accomplished? Is it looking at the names in this textbox to determine how many tasks to create?

Scott

# November 5, 2008 9:56 AM

ginni said:

Hi Scott,

I have not used any code. I am just using SharePoint Designer. In that, i have set "task assigned" field to this text box and it is assigning tasks to all those people whose names appear in this text box. It is sending mails too but also creating one extra task with a blank name.

Ginni

# November 5, 2008 10:15 PM

ginni said:

Hi Scott

I want to ask one more think. Is there a way of resolving the names in the contact selector control by just hitting the enter key rather than pressing the check names button?

Ginni

# November 6, 2008 6:11 AM

ginni said:

Sorry its not think, its thing

# November 6, 2008 6:12 AM

infopath said:

Hi Ginni,

I am not sure why SharePoint Designer would be adding an additional blank row like that - I wonder if it is because it interprets the trailing ";" as a new entry?

If you want, try changing the expression that concatenates the values to this (this is still based on the sample here so field names, paths, etc. would still need to be verified):

substring(xdMath:Eval(xdMath:Eval(../my:attendees/my:attendee, 'concat(my:attendeeEmail, ";")'), ".."), 1, string-length(xdMath:Eval(xdMath:Eval(../my:attendees/my:attendee, 'concat(my:attendeeEmail, ";")'), "..")) - 1)

All this really does is remove the trailing ";" from the concatenated list of values.

In regard to the Contact Selector question, the only way to validate a name is to:

- Click the "Check Names" button

- Tab to the "Check Names" button after entering a name and then you can use the Space bar

- Use the "To" button where the Enter key will work to perform the search and the selection.

Scott

# November 6, 2008 9:49 AM

ginni said:

Thanks a ton Scott. Its working great. I am very grateful to you.

# November 7, 2008 1:41 AM

infopath said:

Excellent! I am glad to hear it works as you need Ginni...

Take care,

Scott

# November 7, 2008 8:04 AM

ClaytonCobb said:

Scott,

In reference to our exchange back on Oct 9th, I have the information you requested regarding the properties of my ContactSelector.dll:

Size: 187 KB

Version: 12.0.6211.1000

Date Modified: 8/24/2007 2:36 AM

I'm still baffled as to how a form that someone sent me works fine (after tweaking the settings to match my environment), yet no form I create myself following the instructions will work.  You would think that through deductive reasoning, I'd be able to find the missing link or errant variable, but I see no differences at all.

# November 10, 2008 5:03 PM

ClaytonCobb said:

Scott,

Disregard it all.  Using the working form and my non-working forms, I slowly ate away at the differences and kept breaking the good form one piece at a time until I narrowed it down to the final variable, and it truly was just the thing you told me to do at the beginning.

No matter how many times I looked at the syntax of the XML fields, I never noticed that the "d" in "AccountId" was capitalized in my forms but not in your write-up (nor in the good form).  I guess the capital "I" kept throwing me off into thinking the "d" was also capitalized, but oh well.  The moment I changed that one character, it all started working.  I am now making some nice workflows using this (using the AccountID element) and will be changing many of my other nice forms to use this feature instead of having to use custom contact lists with drop-downs.

Thanks for all the help.  Now, I wish I could delete all the previous posts except the first one!  =P

# November 10, 2008 6:36 PM

infopath said:

Hi ClaytonCobb,

I am very glad to hear everything is working now! (It's always the little things...isn't it? <g>)

Take care,

Scott

# November 11, 2008 7:37 AM

cheshirefury said:

Hi Scott

I have spent a great deal of time reading though this Blog and its replies(which I must say has be overwhelmingly helpful).

But

I’m having a few little issue I’m hoping its a easy fix or at least you can point me in the right direction.

I have a Browser enabled InfoPath form with the contact selector working on it. This form submits to a list in SharePoint site but its unable to properly receive the data from the contact selector as it needs a format of 1#;JohnSmith or 32#;JaneSmith for it to be submitted to a list.

I can concat  the info I receive from the Contact selector so i can submit to the list. But I don’t know how to get the ID to submit to the site Or is there a easer way to submit to the list and I’m going about this all wrong.

# November 16, 2008 7:24 PM

infopath said:

Hi cheshirefury,

If you are just submitting new records to a SharePoint list then you should not need the ID. Have you seen this post:

http://blogs.msdn.com/infopath/archive/2007/03/26/submitting-to-a-sharepoint-list.aspx

Now if you need to also edit/delete items from a SharePoint list you will need to use code and in the above post (you will need to review the comments) there is sample code to perform edits and deletes.

Scott

# November 17, 2008 8:28 AM

NohaMohsen said:

Hi Scott,

Really a great post and comments...

But I have 2 questions:

1)What if i need this contact selector to connect to an active directory(not to the sharepoint active directory) what shall i do??is their any changes that i can do to the context file or even add a data connection to the data connection library??(in this case i will use a web service and put the url of that web service in the data connection library)

2)second what if i want it to display the email,and the email can't be formulated from the display name?? and can we display that mail instead of the displayname field??

I will be greatful if you answered my questions.

# November 18, 2008 6:44 AM

infopath said:

Hi NohaMohsen,

There is not a way to change where the Contact Selector control queries its data so there are a couple of options:

1) Write your own code behind InfoPath or in a web service to query Active Directory

2) If you have Microsoft Office SharePoint Server (MOSS) you could look at using the "Profile Database" and you can pull information from your AD into the profile database. Now this would not change how you use the Contact Selector control but what you could do is use that control to find/make a selection and then pass that user account to the "User Profile Service" (MOSS web service) to return information about that user...including their e-mail.

In regard to displaying the e-mail - as you have seen this is not a property that is returned in the Contact Selector data. So you can use the Profile database as noted above or - if your e-mail addresses are consistent (i.e. user@yourdomain.com) then you can parse what is returned by the Contact Selector control and constuct the e-mail address. (For more information on this option, take a look at the June 16th response I provided.)

Scott

# November 18, 2008 8:17 AM

cheshirefury said:

Cheers Scott

There is other reason im submitting via the code one of the reason's is that i am having a lot less issues and more control on the form doing it this way.

ATM its looking as though i wont me able to avoid doing it the code way. Is there still a way to submit if i do it the "code" way.

# November 18, 2008 9:23 PM

infopath said:

Hi cheshirefury,

I am not sure I follow your question: are you asking if there is a way to submit to a list via code? If so - then yes and just take a look at the prior post I mentioned.

Scott

# November 19, 2008 8:20 AM

NohaMohsen said:

Hi scott,

Thanks for the quick reply,and i did the email part...

But regarding the AD part,how shall i implement that??I only have an event for the value changed and no other events....how can i handle the "Go button " present in the custom contact that does the search??

If you have a sample code for that ,that will be great.

NohaMohsen

# November 19, 2008 11:51 AM

cheshirefury said:

Sorry Scott for the confusion.

Im only looking for a way to submit the data from the Contact Selector Control to a "assigned to" list column via code.

I have looked though the coments on this page and

http://blogs.msdn.com/infopath/archive/2007/03/26/submitting-to-a-sharepoint-list.aspx

But im still missing what im after. I will check though the comments again and see if i can find it.

Sorry for all the hassle it just i have been looking for a solution to this for a while now.

# November 19, 2008 5:41 PM

infopath said:

Hi NohaMohsen,

If you want to use code to query Active Directory from the Contact Selector control, you can use the "Changed" event for the "Person" node. Here is some sample code:

NOTE: You will need to add the following "using" statement (and reference if it is not already there)

using System.DirectoryServices;

public void Person_Changed(object sender, XmlEventArgs e)

       {

           if (e.Operation == XmlOperation.ValueChange || e.Operation == XmlOperation.Insert)

           {

               //Create a NamespaceManager object

               XmlNamespaceManager ns = this.NamespaceManager;

               //Create an XPathNavigator object for the main DOM

               XPathNavigator docXN = this.MainDataSource.CreateNavigator();

               //Create a string variable to store the selected users "AccountId"

               string userName = docXN.SelectSingleNode("/my:myFields/my:gp1/my:Person/my:AccountId", ns).Value;

               //For AD, using the "samaccountname" we just want the login name so parse that value

               userName = userName.Substring(userName.IndexOf("\\") + 1);

               //Create a new AD SearchResult object using a DirectorySearcher object and passing it

               //the userName value

               SearchResult result = new DirectorySearcher("(samaccountname=" + userName + ")").FindOne();

               //Insure we found a user

               if (result == null)

               {

                   MessageBox.Show("Error finding user: " + userName);

               }

               else

               {

                   try

                   {

                       //Create a new AD DirectoryEntry object using the GetDirectoryEntry method

                       DirectoryEntry employee = result.GetDirectoryEntry();

                       //Get the user's full name by calling the displayName property

                       string FullName = employee.Properties["displayName"].Value.ToString();

                       //The following returns the manager's name and additional AD info - so we will

                       //parse this to get just the name

                       string ManagerName = employee.Properties["manager"].Value.ToString().Substring(3, employee.Properties["manager"].Value.ToString().IndexOf(",") - 3);

                       //Get the user's location

                       string strLocation = employee.Properties["physicalDeliveryOfficeName"].Value.ToString();

                       //Get the user's title

                       string strTitle = employee.Properties["Title"].Value.ToString();

                   }

                   catch (Exception ex)

                   {

                       MessageBox.Show(ex.Message);

                   }

               }

               result = null;

           }

       }

# November 20, 2008 6:08 PM

infopath said:

Hi cheshirefury,

Ah - this helps...submitting to the "Assigned To" column is different. First of all, the name of the column is: AssignedTo and what you send to this column is the SharePoint "User ID", a numeric value.

So when I, say, want to submit to the Tasks list (which has an Assigned To columnn) I submit a value of: 1 and this shows as: Scott Heim.

So the key to this is you need to get the SharePoint User ID for the user selected in the Contact Selector control and then send that value to the Assigned To column. You can easily do this with a custom web service on your server that takes the site and selected user as parameters and then simply call: web.AllUsers[passedInUserName] - as this will return the User Id.

Here is a sample web method:

[WebMethod]

   public int GetUserID(string strSite, string strDomainUser)

   {

       if (strDomainUser != "")

       {

           SPSite site = new SPSite(strSite);

           SPWeb web = site.OpenWeb();

           SPUser user = web.AllUsers[strDomainUser];

           return user.ID;

       }

       return 0;

   }

Scott

# November 20, 2008 6:14 PM

Elfoamerican said:

You can easily get email at least for the predetermined amount of entries if you have access to the Sharepoint's UserProfileService.asmx without writing any code behind.

For example for the first entry all what you need is to assign that field in an action:

my:gpContactSelector/my:Person/my:AccountId[1]

to the service parameter:

/dfs:myFields/dfs:queryFields/s0:GetUserProfileByName/s0:AccountName

in the next action you should call Query using data connection

after that  you should have your email populated in the service structure

# December 3, 2008 1:11 PM

abhishekv said:

Hi,

This is a great article.

I am new to infopath. I have implemented this contact selector control and it is working properly in Infopath.

I have published this in Sharepoint and is opened from there.

Say my name is Ramanan, Abhishek(Lastname, FirstName), and I enter 'Rama' in the contact selector and click search I am gettin this error.

'There was a form postback error. (User: MEDIMMUNE\VenkataramananA, Form Name: New Card Application Browser, IP: , Request: http://md1vm098/_layouts/Postback.FormServer.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:New-Card-Application-Browser:-myXSD-2008-12-08T17-19-57, Type: SchemaValidationException, Exception Message: Schema validation found non-datatype errors.)'

Please help ASAP.

# December 9, 2008 5:38 PM

infopath said:

Hi abhishekv,

Here is where I would start to troubleshoot this:

- Enable Verbose logging for the following categories:

    - Feature Infrastructure

    - Forms Services Data Objects

    - Forms Services Runtime

    - Forms Services Runtime - Data Connections

- Reproduce the error and then check the latest SharePoint ULS log...hopefully this will point you to a more specific error indicating the problem.

If you don't get any additional details in the logs then I would select the "All" category, set this to Verbose, repro the error and check the logs again.

We should be seeing something in the ULS log that points you to the issue.

Scott

# December 10, 2008 9:29 AM

Elfoamerican said:

Here is my blog where email problem is solved

http://alecpojidaev.wordpress.com/

# December 16, 2008 4:41 PM

prabhu@prabhakaran.com said:

Hi Scott,

Thanks for the great article.

I am using contact selector in browser based InfoPath form. In the form there are three contact selector and they are optional based on business logic.

By default I have assigned a value “NA” to the AccountID field. This defaulted value is also used in the associated workflows.

Whenever this form is opened, there is a 7 to 20 second delay. When I went thru the SharePoint logs, I noticed a error message “Error in resolving user 'NA' : System.Runtime.InteropServices.COMException (0x8007203A): The server is not operational”. This message appears maximum three time and each one takes approximately 7 seconds (timeout).

To eliminate this I have changed the form by setting AccountID field to blank. Now I do not get this timeout.

My question is:

[1] When a correct full name or account ID is entered, the control validates in no time. But whenever a wrong/partial user name is entered in the control for validation, the control takes 7 seconds to return back. Why this much of a delay?

[2] Is this timeout set in SharePoint or AD? Any way to reduce this timeout?

Thanks

Prabhu

# December 30, 2008 3:23 AM

infopath said:

Hi Prabhu,

This behavior is not specific to the Contact Selector control - if you were to enter: NA in one of SharePoints "People Picker" controls, you would see the same behavior. This is because that control (People Picker and Contact Selector are basically the same control) is attempting to validate that user (in this case the "NA" user) in every domain in your forest. The same is true for an invalid user. If you just enter the invalid user name, it attempts to validate that user in every domain. If you were to enter an invalid user as: domain\invalidname then it would attempt to validate that user just in that one domain.

To the best of my knowledge there is no way to control a timeout on these controls but if you want to be 100% sure you may want to post that question to a SharePoint blog.

Scott

# January 5, 2009 11:04 AM

hiszorn said:

We are setting our contact selector from a workflow and when our browser form is opened, the selector shows strange information in front of the name like 16:#  Has anyone seen something like this?  Any ideas of how to fix that?  Thanks!

hiszorn

# January 11, 2009 1:07 PM

infopath said:

Hi hiszorn,

I am not a workflow expert but I have seen this same behavior depending on how I pull the information from SharePoint. If you step through your workflow code that pulls the user name, before you populate the control do you see the "16#" information? If so, then you should be able to strip that off using the substring function.

Scott

# January 12, 2009 9:10 AM

hiszorn said:

Hi Scott,

For some reason, this strange value changes to different numbers (16;# and 17;#) depending on the person the selector has been set to.  I will check to see if we can see that value in the workflow.  Strange one though...

hiszorn

# January 12, 2009 12:51 PM

NohaMohsen said:

Hi SCott,

Do you have any idea how can i call from the code the validate of the control....that is it validate what is entered in the field by calling the code.

# January 29, 2009 7:50 AM

infopath said:

Hi NohaMohsen,

I am assuming that what you want to do is validate the text that is entered before the control resolves that user name - correct?

If so - I know of no way to do this. You could add code to the "Validating" event of the "Person" node but this fires after the control has resolved the name.

One possible option would be to have the user enter the text in a text box control (maybe initially you would have the Contact Selector control hidden) so you could validate the data that was entered. Upon validation, set the "DisplayName" node of the Contact Selector control to what they entered and then make the Contact Selector controkl visible. The user would still need to click the "Check Names" button to resolve the user but at least you would have the ability to validate the text they entered.

Scott

# January 29, 2009 8:12 AM

UK SharePoint Team said:

InfoPath is a great tool that allows you to quickly design and implement browser-based electronic forms

# February 3, 2009 7:14 AM

fodi said:

Hi Scott,

I've created a custom SharePoint workflow in VS2008. It uses InfoPath task forms to manage the approval process.

When a workflow task task form is opened in Outlook 2007, the user can complete the form by clicking the "Edit this task..." button directly in Outlook.

This is the first time I've had to add a contact selector control to a task form. The contact selector works correctly when you modify the task from within SharePoint.

When I modify the task from within Outlook, the contact selector does not return any names and responds with "Search failed.".

I created a Context.xml and set it as a 'receive' datasource as you recommended, to no avail. Have you any suggestions on this one?

- fodi

# February 9, 2009 10:59 PM

fodi said:

Scott,

I think I solved this issue. After trying to fix it for two days, I posted on the forum and fixed it an hour later... go figure.

In the end, I used the full Context tag, as described on MSDN:

<Context

isStartWorkflow="false"

isRunAtServer="true"

provideAllFields="false"

siteUrl="http://myServer.FQDN"

/>

I don't think that's what fixed it though.

Golden rule: If you've got InfoPath installed locally it will cache forms. This also applies to forms that are opened within Outlook 2007. After making changes to these forms, make sure you run:

Infopath /cache clearall

Hope this helps someone else down the track.

- fodi

# February 10, 2009 12:18 AM

infopath said:

Hi fodi,

Thank you for the information - I am glad you were able to get this working!

Scott

# February 10, 2009 8:18 AM

ganeshba said:

How do I reset an entry in the contact selector?  I have only one entry picked.  To reset, I set the DisplayName value to "".  It seems to work in Infopath but on the browser version via Sharepoint, the entry does not clear.   Will it require custom code?

Ganesh Bala

# February 28, 2009 3:21 AM

Phil Birkland said:

I have two issues with my contact selector:

1)  I have several contact selector's on a form. The form has a submit button that submits the form to email not as an attachment. The contact selectors always show up black, and I am unable to read the what the user entered into the form. I try to change the background color, and it appears as though it works, but then it reverts back to black as soon as I go back to the properties to see if my change persisted.

2)  Infopath has been crashing on me consistently whenever I hit Print or Print Preview not from the template but from a filled out form, or a preview of the form. I have isolated the occurrence of the crash to only occur when a contact selector is on either my print view or even the normal view.   Any thoughts on what to do to resolve this crash and still use a contact selector? Or any other ideas?

Not sure if these two are related or not, but it seems plausible.

# February 28, 2009 9:02 PM

infopath said:

Hi Ganesh,

To clear the Contact Selector control in a browser form, there are two things you will need to do:

1) Use a Rule to set all three fields for the Contact Selector to an empty string

- Action: Set a field's value

- Field: DisplayName

- Value: <Just leave this blank>

Do the above for all three fields

2) Assuming you are using a button to clear the Contact Selector control, you will need to change the postback setting to "Always"

- Right-click on the button and choose Properties

- Select the Browser Forms tab

- Change the Postback setting to Always

Re-publish the XSN.

Scott

# March 2, 2009 10:55 AM

infopath said:

Hi Birkland,

- For question #1: are you saying that when the form is received in e-mail you cannot make out the text in the Contact Selector control or is it the entire form that is "black?"

- For the crashing question, do you get the same behavior if you create a completely new XSN following the steps in this blog post?

Scott

# March 2, 2009 11:00 AM

Phil Birkland said:

Hi Scott,

- Just the contact selector is black.  You can see a screenshot at:

http://picasaweb.google.com/lh/photo/z8Ljf9v_auhMjmlamQCQXQ?feat=directlink

Also, I have checked the background color, and tried to change to another color, but after I hit ok, and go back to verify my change, the color is back to black again.

- I have to give this a try ... more to come ...

Thanks for your help!

Birkland

# March 2, 2009 6:47 PM

Phil Birkland said:

Hi Scott,

So I tested this with a new form, and it appears as though the form only crashes when I open an infopath form that has already been submitted to my document form library.  If I start any new form, fill in data, and hit print preview or print then it is fine.

Phil

# March 2, 2009 9:02 PM

infopath said:

Hi Birkland,

OK - I've done some testing on my side and I am not seeing the same behavior as you in regard to what you see in mail. I have tried with my submit connection set to both attaching the form and not attaching the form and in both cases, I actually see nothing in the Contact Selector control (in fact, I don't even see the Contact Selector control.)

Now, this actually makes sense since this is an ActiveX control and the information being stored is in the DisplayName, AccountId and AccountType fields.

So I am not sure why you are seeing black but even if you didn't, you will probably want to create an "e-mail" view where you don't have the Contact Selector control but simply the DisplayName or AccountId fields in its place. You would first switch to this view and then send your mail. (NOTE: You should be able to just copy/paste all the controls from your current view to a new view and then simply remove the Contact Selector control and replace it with one of the other fields.)

In regard to InfoPath crashing when Print or Print View is used with the Contact Selector control - I found this is a known issue that our Product Group. Now again in my testing, I can successfully use: File | Print | Print Preview but if I just choose Print Preview from the File menu it fails.

Scott

# March 3, 2009 1:46 PM

Phil Birkland said:

So if for the contact selector showing up black, if I have two submit actions.

1. Submit to library

1.5 change view to print preview view, or would a print preview not work.  I thought I had tried this, and the entire form was white or blank, I couldn't see anything, but I did not try a regular view as opposed to a print view.  I'll give that a go around.

2. Submit to email

I will also test out just using the File Print Preview action as well.

Thanks for your help.  

Birkland

# March 3, 2009 7:24 PM

Phil Birkland said:

Hi Scott,

Even File | Print | Print Preview throws exceptions on me everytime.  I also moved my other issue regarding changing views for emails to somewhere that seemed more appropriate on your blog at:

http://blogs.msdn.com/infopath/archive/2007/01/17/emailing-a-custom-view.aspx?CommentPosted=true#commentmessage

Birkalnd

# March 3, 2009 8:19 PM

infopath said:

Hi Birkland,

I am not able to reproduce the crash on XP or Vista machines using File | Print and then clicking the Preview button.

Keep in mind, I am testing using the same form as what is designed in this sample so there may be something else going on with your form template.

I also have Service Pack 1 installed for Office - so if you can repro the crash using the same form as designed in this blog post and you have SP1 installed for Office 2007 then you will probably want to open a support case so an Engineer can dig into this more, capture traces, etc. to try and isolate the issue.

Scott

# March 4, 2009 8:09 AM

slslusehr said:

I'm a little new to writing code and for some reason I can't get the control to work.  The search keeps failing.  I'm pretty sure it has something to do with the way I'm pointing to the server.  Here's what I'm putting.

<Context siteUrl="http://doc1xxxxx103"/>

Should I be using the site url where the form is published?

<Context siteUrl="http://sitename/subsitename"/>

Sherry

# March 4, 2009 5:37 PM

Phil Birkland said:

Hi Scott,

I figured out what it was with the crash.  I had the view set to as a print view.  But then under View | Print Multiple Views settings, the non print view was selected as the one and only view to print.  I changed this to the print view, and duhh, things worked just fine.

Thanks again,

Birkland

# March 4, 2009 8:57 PM

ganeshba said:

Hi Scott,

Your response to my question on

"How do I reset an entry in the contact selector? "  was a life saver and it worked out great.

Thank you

Ganesh Bala

# March 4, 2009 10:48 PM

infopath said:

Birkland - nice find! Glad that the Print Preview is now working for you. :)

Ganesh - I am happy to know the information helped!

Sherry - The "Search failed" may or may not be related to the URL you are entering. That is certainly the first thing I would change and see if it makes any difference. If not, let me know and I will have some additional troubleshooting tests.

Scott

# March 5, 2009 8:25 AM

amo368 said:

I am still having issues with Printing the Contact Selector field. I have made a sepeerate printing view but still seem to not be able to print it... I'm somewhat of a novice at infopath so any replies please make them accordingly. Thanks for your help in advance...

What I have done so far:

1. Made seperate printing view first with display name, then with the other option listed above. Both did not work.

2. jacked with the print multiple views option but that didn't work either.

# March 9, 2009 6:13 PM

infopath said:

Hi amo368,

Can you provide more detail around what did not work? For instance, when you create a separate print view you would not include the Contact Selector control - you would just include the DisplayName and/or the AccoundId nodes.

Now, once this is done you will need to specify your "printing" view as the "print" view:

- Open the XSN in Design View

- Select the Views Task Pane

- Click on your Default view and click the Properties button

- Select the Print Settings tab

- Make sure your new "print" view is set in the "Designate an existing view to use when printing this view" box

- Repeat the above for all views you have in your XSN

Scott

# March 10, 2009 8:34 AM

amo368 said:

Awesome! THanks! That worked, now I just need to tweak it to make it look good. Thanks a LOT. You dont know how much heartache you saved me.

# March 10, 2009 10:12 AM

Phil Birkland said:

Hi Scott,

I have another question for you, the IT police at my organization are yelling at me, since the data or email recipients that are tied to sharepoint through this web service is not entirely accurate for reasons I do not understand quite yet.  One of the reasons for this is that the sharepoint directory of users contains members that have left the company, and are no longer active in the normal outlook exchange directory.  Also generic IDs are included in the sharepoint directory of users, and PDLs are not in sharepoint

The recommendation to me was to search out other controls that would not use a sharepoint directory by tie more directly with the outlook directory, possibly through the control "Microsoft Office Outlook: recipient control" or something similar.  

Are there other similar controls?

Thanks,

Birkland

# March 17, 2009 3:38 AM

infopath said:

Hi Birkland,

There are no other "out of the box" controls that do this. If you are creating an InfoPath Form Template that will *only* be used in the InfoPath client then you could conceivably create your own custom ActiveX control to do what you want; however, if your form will be used in the browser then this is not an option as Forms Services (browser forms) do not support any custom ActiveX control.

The other option would be to simply use a text box for the user to enter the name, logon, whatever and you use custom code query your Active Directory for that user.

Scott

# March 17, 2009 8:00 AM

harbrich said:

Haha Scott I just wanted to mention I think it's funny how long this comment list has become. You are a champion for keeping up with all the different queries, ideas and responses.

*tips his hat*

# March 25, 2009 11:45 AM

infopath said:

Thanks harbrich! :)

# March 25, 2009 11:49 AM

DaFlea said:

Great article but I have a question....

I have the contact selector working on the form, however every time I select an employee from AD and goto insert another item. The repeating region goes blank on my form.

I have been searching the web for some examples of how this control is being used to examine what I may be doing wrong, but I am coming up empty. Does anyone have some suggestions that could aid me on this issue?

Thanks,

Doug

# March 27, 2009 4:07 PM

infopath said:

Hi Doug,

I am not sure I understand the behavior you are describing. Do you have the Contact Selector control in a Repeating Section? Can you describe your setup more so I can get a better understanding of how your XSN is designed?

Thanks,

Scott

# March 27, 2009 4:36 PM

DaFlea said:

Scott,

Thanks for your reply.

What I am trying to achieve is a repeating list where each line will allow you to select a person from active directory using the contact selector. What happens is after I fill out all the items including the contact selector item and click the insert item to add another line is when the problem starts. Everything in the repeat region completely disapears, it is as if it was never there.

Am I using the control incorrectly, should it not not be used in the repeat region.  Or should it be outside the repeated region.

Thanks,

Doug

# March 27, 2009 10:59 PM

infopath said:

Hi Doug,

This should work for you - here is some sample steps I just tried that work fine for me:

- Create a new, blank XSN

- Add a Repeating table with 2 columns

- Delete "field2" ( = the 2nd column) and delete the text box from the table for field 2. At this point, my data source looks like this:

myFields

    group1

         group2

              field1

- Add the correct data structure to the data source for the Contact Selector:

myFields

    group1

         group2

              field1

              gpContactSelector (Group, non-repeating)

                   Person (Group, repeating)

                        DisplayName (Fields, Text)

                        AccountId (Fields, Text)

                        AccountType (Fields, Text)

- Drag "gpContactSelector" to the repeating table where field2 used to be and choose Contact Selector

- Add the connection for Context.xml

- Test!

When I do this, I can add multiple rows and each Contact Selector is updatable and independent of the other.

Scott

# March 30, 2009 11:39 AM

DaFlea said:

Scott,

Ok I have try what you have instructed in a new form and in the one I am playing with.

However now when I place a name in the contact selector and click the check mark I get no results and the contact selector gray's itself out... This is far better than everything disappearing like before

I have re verified my case to make sure everything matches and I am using the same XML file as before so I know it was linking back the server correctly..

Any suggestions...

# March 30, 2009 12:53 PM

DaFlea said:

Let me rephrase whats going on because I have had some different results now.

The new form still will not find anyone in the directory, which I believe is due to the fact its not prompting me for credentials to the SharePoint site. I did find an error on my part not putting the Person repeating group in the list however this still doesn't allow it to work.

My original form I have been working with will now look up the contacts again, same issue forgot the Person group as well.  However after picking the person in the directory the control will gray out making it usable.

The original form does ask for credentials when opening because I have it attached to some SharePoint Lists.

FYI: Currently the way we are setup is not everyone is on a central domain and everyone has to access the site over http causing them to log on when things are accessed.

# March 30, 2009 1:43 PM

infopath said:

Hi Doug,

The only time I have seen the "grayed out" behavior is when the Contact Selector nodes either not spelled correctly *or* the case of the names is incorrect. For instance, if I simply change: AccountId to AccountID, the form will open fine and the control will appear to work but as soon as I select a user, it becomes grayed out.

So the first thing to check is the capitalization on all nodes specific to the Contact Select control (Person, DisplayName, AccountId and AccountType) have the correct capitalization.

Scott

# March 30, 2009 2:12 PM

jestiles said:

I have a couple of questions/issues about the CSC since we upgraded our MOSS 2007 to a 64-bit machine...

I have added the Contact Selector to my browser-based form and followed the steps suggested to make the control required, however, as soon as I click in the control itself, the page refreshes and submit is enabled. This happens before I even get to type a name.

When typing a name in the control to resolve against AD, sometimes the name will resolve and other times it doesn't. It is very random as to when this happens!!

Also in this, if a user in AD has 2 accounts (one is their voicemail acct and the other is their regular email acct) a box pops up for them to select which account to use each and every time you type that users name. In our 32-bit environment it didn't do this.

Any help or suggestions is greatly appreciated!!

Thanks,

Jessica

# March 30, 2009 2:18 PM

DaFlea said:

I will call this a dyslexic moment for me... The AccountId got me. I must have had it misspelled because the Id part was right. After retyping it everything work like a charm.

Thank you for your help on this matter.

# March 30, 2009 2:28 PM

infopath said:

That's great to hear Doug! :)

# March 30, 2009 2:35 PM

infopath said:

Hi Jessica,

Let's look at each of your scenarios:

#1: Automatic postback when clicking into the CS control: I just tested this on a 64bit server and am unable to repro that behavior. I simply added a text box control to the sample I created here, pleaced it above the CS control (so it would receive focus first) and opened the form in the browser. When I then click into the CS control, nothing happens.

Now, the way I am validating that the Submit button is not enabled is to check if the DisplayName field "is blank" - is this what you are doing? Do you have any code behind the InfoPath form?

#2: Random resolution of names: I honestly don't have any ideas on this...does it randomly not resolve names that it used to or is it just not resolving some names? Without being able to repro this though or get a repro nailed down, I don't know that I will be able to offer much help.

#3: Account to select: This obviously makes no sense since the control is still 32bit and Office (which you are using to publish) is 32bit. Does the same behavior occur if you use the SharePoint People Picker control to add that same user to give them permissions to, say, a test library?  (Obviously to test this you would need to break inheritence for that library and try to add the user explicitly.) If this does not reproduce the issue, then this would probably be worth opening a case with the InfoPath team so we can look into this more. I would need to setup a repro which will take a while to get multiple accounts for the same user on our domain.

Thanks Jessica!

Scott

# March 30, 2009 2:57 PM

Mario Cortés Flores said:

Cuando diseñamos un formulario para ser utilizado en Infopath Forms Services debemos tener en cuenta

# March 31, 2009 1:52 PM

UK SharePoint Team said:

Some time ago now, I published a post entitled Quick Tip: Using the SharePoint ‘Person or Group’ field

# April 17, 2009 6:50 AM

amdMcBook said:

Putting the server URL in the Context.xml is great, but how does one handle moving the XSN from Dev to QA to Prod without having to resort to editing, publishing (and in my case WSPing) the XSN file once for each environment?

I have tried to workaround this by always using the Prod url regardless of the environment, but I am getting "Search Failed" when I do that. I do seem to have permissions to the prod site (i can browse to the root URL http://myserver.com)

Any best practices around this? Thanks

# April 26, 2009 10:40 PM

infopath said:

Hi amdMcBook,

For this specific issue (updating the server URL in the Resource file) there are a few options:

1) As mentioned, update it and re-publish the XSN

2) You could use code on the Loading event of the XSN to set that value to what you want it to be. This will not persist once the form is closed but if the code is on the loading event, it will run each time and update that value for that instance of the form.

There is not a way to point this to something like a "config" type of file and have it pick up the change.

NOTE: If you are using this in a browser form, it has been my experience that it really should not matter what URL you enter in the Context file. This will come into play when opening the form in the InfoPath client since it needs to know what site should be used but in the browser, it will execute the search based on the URL used to open the browser form.

Scott

# April 27, 2009 8:27 AM

UK SharePoint Team said:

I know what you’re thinking ….”Wooohooo … yet another article from Martin about InfoPath and the Contact

# April 29, 2009 4:16 AM

The Exception said:

Hi scott,

I am using contact selector control in a repeating table. Now i want that a mail should go to all, whose names i mention in contact selector control in each row. I am writing only single name in a contact selector control in each row.

How can i do this?

# April 30, 2009 8:49 AM

infopath said:

Hi,

You can do this by adding a new field to your data source and setting the default value to something like this:

substring(xdMath:Eval(xdMath:Eval(/my:myFields/my:gpContacts/my:gpContact/my:group1/my:Person, 'concat(substring-after(my:AccountId, "\"), ";")'), ".."), 1, string-length(xdMath:Eval(xdMath:Eval(/my:myFields/my:gpContacts/my:gpContact/my:group1/my:Person, 'concat(substring-after(my:AccountId, "\"), ";")'), "..")) - 1)

NOTE: Here is my sample data structure, which places the Contact Selector control in a repeating table:

myfields

    gpContacts (Group, non-repeating)

         gpContact (Group, repeating)

              group1 (Group, non-repeating)

                   Person (Group, repeating)

                        DisplayName

                        AccountId

                        AccountType

I then added a new node to my data source (it does not have to appear on your view but is a good idea initially for testing) called: emailAddresses (I just right-clicked on the root myFields node and added the field.)

If your data source is setup *exactly* as I have described above you should be able to do this:

- Right-click on the new emailaddresses field and choose Properties

- Click the "fx" button next to the Default Value box

- Enable the option "Edit XPath"

- Paste in the expression noted aboive

What this will do is add each selected name in the repeating table to the "emailaddresses" field separated by a semi-colon.

I hope this helps!

Scott

# April 30, 2009 9:13 AM

ThomasCBarkley said:

I have an unusual scenario, my client wants an InfoPath for to select contact from the local Outlook contacts list.

Is there a way to do this?

Thanks

Thomas

# May 5, 2009 10:50 AM

infopath said:

Hi Thomas,

There is no out of the box way to accomplish this - you would need to create a custom process for your customer.

Scott

# May 5, 2009 5:27 PM

ginni said:

Hi Thomas

There is one way to do this. It is not the best approach but see if this is little helpful. Make a SharePoint custom list and put all the contacts in that list. Now while designing an Infopath form, u can set a receive data connection from that custom list. In this way u will be able to see all the contacts and your client can easily select. U can use list box to show all the contacts.

Regards

Ginni

# May 15, 2009 6:31 AM

ginni said:

Scott,

I really admire u for answering each and every doubt of everyone. Really, i appreciate u a lot for this. Scott, few months back u gave me the solution of sending mail through contact selector to several people. Now i have a doubt. If i select a group in Contact Selector, then it is sending mail to all the members of the group but i also want the users to see the members of that group. While sending mail and in infopath form, it only shows the name of the group but not the members.

Now how should i extract the names from the group(which i entered in Contact Selector) in infopath form?

Regards

Ginni

# May 15, 2009 6:38 AM

infopath said:

Hi Ginni,

The only information returned in the Contact Selector is simply the name of the group if its been validated. As such, you would need to use another call (i.e. to a web service) to get the users that are part of the group.

There is a SharePoint "UserGroup" web service (usergroup.asmx) that can be used to enumerate the users in a specified group. In order to use this in InfoPath you will need to make some modifications to the XSD files that are created when you make the connection and the steps to use this web service are documented here:

http://www.infopathdev.com/forums/t/11482.aspx

Scott

# May 15, 2009 5:08 PM

ginni said:

Hi Scott,

I read that article. Its nice, but there i need to mention the name of the group while setting a data connection and also at one connection i can mention the name of only one group.

My requirement is like i want to get the usernames of the group which i will mention in the Contact Selector control.

I am not getting any info regarding this anywhere. Can me help me in this?

Regards

Ginni

# May 16, 2009 9:24 AM

ginni said:

I mean can u help me. Sorry for the last line

# May 16, 2009 9:27 AM

infopath said:

Hi Ginni,

As you know, the users or groups you select in the Contact Selector control are stored in the repeating "Person" node. So what you can do is use code to loop through all the rows in the repeating Person node and pass each selected group to the "UserGroup" web service to return back the users in that group.

There is no out of the box way to do this so you are going to need to implement something custom like this to get what you want.

Scott

# May 18, 2009 8:07 AM

BlueChan said:

Scenario: Initiator fills out a new form opened from a Sharepoint forms library and sends it to an approver. While filling out the form the initiator selects users with the contact selector. The approver receives the form via email and opens the form to add users via the contact selector.

Problem: While the initiator fills out the form the contact selector works just fine. But when the  approver opens the form from Outlook we get the following message when we try to validate a user in the Contact selector:

"This action cannot be performed from untrusted sites. To use Find, you must add this site to the list of trusted sites for your Web browser."

I've tried to send the form via email without the template which I would have thought would force Infopath to download the template from Sharepoint but this didn't have an effect.

The publish location (Sharepoint site) is in the trusted sites list in IE.

Any help would be appreciated.

# May 19, 2009 12:44 AM

infopath said:

Hi BlueChan,

The reason you are seeing this behavior is when you open an InfoPath form from within Outlook it is being opened in the local IE cache (Temporary Internet Files) - as such, you will see this message. To allow the Contact Selector control to work in that scenario the form will need to be saved to the user's machine.

Scott

# May 19, 2009 9:21 AM

BlueChan said:

Is there a group policy or some other centralized way of working around this?

# May 19, 2009 9:00 PM

robholmes said:

We are experiencing the exact same issue when using the contact selector from within Outlook.  

We tested this out and found that when the InfoPath form was opened from within Outlook it populated the InfoPath cache directory on the local computer with the template and the only items it seem to save to the Temp Internet Files was the images from the form and a cookie.

I tried Scott's suggestion of saving the form locally after it has been sent to an Outlook client and the contact selector did work. However, this isn't a viable solution in our environment as we cannot ask our users to do this as it's not intuitive (especially since the error message infopath prompts with would only confuse them further).

Even adding the local client to the trusted sites list within IE still had no effect and the contact selector was still unusable through Outlook.

Is there another way around this or is this a bug?

Thanks for you help.

# May 19, 2009 10:09 PM

MAV said:

Thanks for all the great info Scott. Really helped out!

# May 22, 2009 4:36 PM

infopath said:

Hi Mav - thank you!

For BlueChan and robholmes...sorry for the delay as I was trying to find a way around this but I came up empty. As such, I have sent this behavior to our product team for review.

Scott

# May 27, 2009 2:10 PM

adayuen said:

First and last name separated by colon instead of comma using "Check Name" in InfoPath browser form "Contact Selector"

Dear All,

I have installed Windows hotfix for making the InfoPath 2007 client application to use comma to separate first name and last name in Contact Selector "Check Name" function. However, I published the same form to SharePoint Server 2007. It failed to separate the first name and last name with comma but colon with "Check Name" function.

The form has been launched for company use and users are not satisfy with the email check name function. Please help to shed some light on how to make the "Check name" function work properly in SharePoint Server 2007.

If there is any patch need to install to SharePoint server, please suggest.

Thank you very much!

Regards,

Ada

# June 1, 2009 11:22 PM

infopath said:

Hi Ada,

Are you referring to the behavior when you display an InfoPath form in the browser? If so, then yes - there is an additional server side fix that you will need for this.

I am not a SharePoint/MOSS expert so I don't want to recommend what you should install as it depends on what service pack for MOSS you currently have installed. I believe the server side fix was part of an Infrastructure Update (see http://support.microsoft.com/default.aspx?scid=kb;EN-US;951297) but again I would suggest you follow-up with either a SharePoint blog or open a support case with the SharePoint team to insure you install the correct update.

Scott

# June 2, 2009 5:41 PM

adayuen said:

Dear Scott,

Thank you for your reply!

I have asked server team to consider to upgrade the service pack.

Beset Regards,

Ada

# June 5, 2009 4:25 AM

adayuen said:

Dear Scott,

It works like a charm for the new Infrastructure Update. This is the best blog for InfoPath form.

Appreciate your knowledgable response.

Thanks a lot!

Ada

# June 9, 2009 5:00 AM

infopath said:

Hi Ada,

That's great to hear!

Take care,

Scott

# June 9, 2009 8:13 AM

Записки свободного Админа... said:

Рано или поздно, всем приходится писать рабочие процессы с формами ассоциации, инициализации, редактиварония...

# June 15, 2009 5:45 AM

davidevan said:

First of all I want to say thanks for a great tutorial. I was able to walk through it and set the control up on a web based InfoPath 2007 form.

I'm running into an issue with this control. The first time I open a form in a browser (IE8) and attempt to type a name into the contact selector input box my browser crashes (instantly on the first keystroke the browser will crash). I get "An unhandled win32 exception occure in iexplore.exe [5460]". I'm able to select users from the list when I select the "To.." button. I'm also able to type in the contact selector input box if a name already exists in it (populated from the To.. button). The only time it crashes is if it's the first time I loaded the form and if the contact selector input box is blank. Any ideas?

# June 18, 2009 10:15 AM

davidevan said:

Ahhh, it turns out to be a bug in Internet Explorer 8! It works fine with IE6, IE7 and Firefox 3. Someone else must be having this problem?

# June 18, 2009 10:23 AM

infopath said:

Hi davidevan,

I am not seeing the same behavior with IE8. I just opened a test form on my site with the Contact Selector control using IE8 and I could type in the name and validate it without issue.

Scott

# June 18, 2009 10:28 AM

davidevan said:

Scott, thanks for the quick reply. That's interesting how it is working for you. I'm using version 8.0.6001.18702 of IE8. What version are you using?

Of course I just tried again and the error still occurs. When you open an exisiting form in IE8 and you use the contact selector, does the error occur?

# June 18, 2009 11:41 AM

davidevan said:

Scott, thanks for the quick reply. That's interesting how it is working for you. I'm using version 8.0.6001.18702 of IE8. What version are you using?

Of course I just tried again and the error still occurs. When you open an exisiting form in IE8 and you use the contact selector, does the error occur?

# June 18, 2009 11:41 AM

infopath said:

Hi davidevan,

Yes - creating a new form in the browser or opening an existing saved form in the browser works without issue for me.

My version of IE is: 8.0.6001.18783 - slightly different than yours.

Scott

# June 18, 2009 11:56 AM

markus.bosch@novartis.com said:

Hi Scott

I could create multiple contact selectors as described above - works like a charm!

But how can I enforce that people have to select at least one contact? If I set the template's value "DisplayName" in the properties pane to "Cannot be blank (*)", I receive everytime I submit the form the error, that DisplayName cannot be blank, though I filled out all required fields on the form.

Thank you for any help.

Cheers

Markus

# June 22, 2009 2:33 PM

infopath said:

Hi Markus,

Yeah - this is not the easiest thing in the world to do. :)

If I may ask, what is it you are ultimately trying to accomplish? (Making sure at least one user is selected before the form can be successfully submitted?)

Scott

# June 23, 2009 10:32 AM

Nick H said:

This blog and your posts were the most helpful thing on the Internet imo.

I am having trouble still with the Contact Selector.  I used the steps you gave an earlier poster:

Created a new Document Library named: ContactSelectorTest

- Enabled the option: Allow management of content types

- Added a new column to this library named: Responsibilities and set the data type to Person or Group

- Clicked the Document Content Type and selected Document Information Panel settings

- Clicked Create a new custom template

The contact selector that appeared in the template was able to access the Active Directory.  My problem is that the template does not allow me to add controls to it (at least not allowing them to be added into the data source).  Vice versa, I was not able to move the working Contact Selector into the template I have been working on.

Any advise is appreciated.

# June 24, 2009 12:17 PM

infopath said:

Hi Nick,

Thanks...

Correct - when you create an InfoPath template in this manner, the schema is locked as it is based on the library. What you would need to do is create whatever columns you need in your library and then modify the Document Information Panel. Now those additional columns will appear in the data source and you can use them on the InfoPath form.

Scott

# June 24, 2009 12:40 PM

Nick H said:

Thanks for the feedback.

I'd prefer doing this sort of thing from Infopath as I have a form I've been working on and I don't know how to add controls like sections via adding columns to my Document Library.  I just wanted to use the Contact Selector in the form I've been working on really.  I just thought that the SharePoint method was good since it seemingly automatically configured itself to search the Active Directory.

# June 24, 2009 1:45 PM

infopath said:

Hi Nick,

Yeah - you certainly have more flexibility when you start with InfoPath. When you start from SharePoint (regardless of from a content type or library) your schema in InfoPath is locked so any changes you want in the XSN need to exist SharePoint.

Scott

# June 24, 2009 3:59 PM

Nick H said:

Scott,

Alright so I am attempting to add a Contact Selector through Infopath following the steps you gave.  I believe that I have successfully completed Steps 1-3.  I am able to drag and drop the gpContactSelector group and choose "Contact Selector" from the menu that pops up.  I have replaced <servername> in Context.xml with many different IPs/server names.  I have attempted:

- SharePoint server name/IP

- Active Directory server name /IP

I am not really sure what the server name I need to replace <servername> with.  I'd appreciate any help.

Nick

# June 25, 2009 11:01 AM

infopath said:

Hi Nick,

You would simply use your MOSS WFE name. If you have multiple WFE's, I am assuming you would then have a load balanced URL and you would use that. However, if this form is to be used in the browser, then it will use the URL of the site it is published to. The server name is really only needed (in my testing) when you use the InfoPath form in the client and not in the browser.

Scott

# June 25, 2009 1:41 PM

Nick H said:

Scott,

I tried using the IP to the load balancer and the url to my mysite on SharePoint but still no dice.

Could you post an example or something of the URL you might put into Context.xml?

Sorry for the hassle, I'm not very hardware or network savvy.

Nick

# June 25, 2009 4:14 PM

infopath said:

Hi Nick,

What do you mean by "no dice" - what is the problem? I only have one WFE, so here is what I have in mine:

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

Scott

# June 25, 2009 4:19 PM

Nick H said:

Alright! I got it working.  Thanks for hanging in there with me Scott.  I believe that I didn't save my Context.xml properly or I didn't add the data connection properly after trying different URLs in Context.xml.

I have a quick question.  Once you have selected a person in the Contact Selector, how is the e-mail address information used?  All I want is to submit a form to each person selected in the Contact Selector.

# June 29, 2009 11:52 AM

Nick H said:

I just read that you do not get e-mail address information from the Contact Selector.  

Maybe in the next version of Infopath, they should add a field that extracts the e-mail address from a contact that is found.

I should be able to get by with parsing the DisplayName attribute.

Thanks again,

Nick H

# June 29, 2009 12:09 PM

dvn said:

But it is doable without using any codes and here is the link to it: http://alecpojidaev.wordpress.com/

I have one question. According to the support Engineer it is posible to create a "contact selector template part" but when i try to create a template part and contact selector control is disabled and i can't add it in to my template part. Has anyone ever done that before?

dvn

# June 30, 2009 11:04 AM

infopath said:

Hi dvn,

This was discussed in the comments as my initial statement was not clear: the template part you create is just the "data structure" which you could then bring into your XSN. You cannot add the control itself to the template part. (Refer to my comment on Apri 16, 2007.)

Scott

# June 30, 2009 11:21 AM

Nick H said:

I apologize for having so many questions.

I tried your validating event code for limiting the Contact Selector to one entry.  If I search and add 2 entries, the validation dashed red box does not show up unless I click check names.  Did I do something wrong, do I need to add something, or is there no way around this?

Thank you for all of the help.  I really do appreciate it.

Nick H

# July 8, 2009 11:02 AM

infopath said:

Hi Nick,

No problem - glad I can help!

Unfortunately you need to validate the user. You can see this if you drah the "Person" node to your view as a Repeating Table. That data structure does not get populated until you validate the user or users selected. And so that you are aware, the same is true if you reverse the process: if you select a user and then just delete the name from the Contact Selector control, it does not get removed from the Person node until you validate the fact that you deleted the name.

Scott

# July 8, 2009 11:17 AM

Sono said:

I have an infopath form with contact selector serving as a workflow modification form. But when I click link to open this form it leads me to the sharepoint page showing "Unknown Error". This form works fine in Non shrepoint environment even I have tried it using as Task Form. It creates problem only while used as modification form. I have tried diagnostic logging as well but no log entry is generated for this error.

# July 12, 2009 10:13 AM

infopath said:

Hi Sono,

If the InfoPath form works fine outside of your workflow then your best option will be to post your question to a SharePoint workflow forum or blog as we do not handle workflow issues.

Scott

# July 12, 2009 5:19 PM

fraygos said:

Hi, this is a great article. Although I found a tiny itty bitty problem. We are using this example to create a service form. Someone makes a request and uses the selector to make choose someone to be assigned this request to.

I have a View for this form where people view requests filtered on the selectors extracted column is equal to [Me]. We then create Alerts from this View to alert our staff when something is assigned to them.

However, when I publish the form, the best I can use is 'Display Name' to filter on but this gives an error when creating the view. It does not allow filtering on 'Display Name' because is multiple lines of text and using begins with or contains produces a render fail on the results of the view, hence stopping the alert. Is the anything I can do to have the column type for the contact selector form be extracted as a type 'Person'.

Is there a better way about going with this?

# July 20, 2009 1:16 PM

Nick H said:

Hey fraygos,

I am new to Infopath so I doubt I can be of much help.

A good way to understand the Contact Selector is to drag and drop gpContactSelector into your form and select "Repeating Table".  Essentially, the Contact Selector adds a row and fills in the row's values every time a contact is selected with the control.  

I looked all over the Internet to find a way to try to get data from a specific row/column of a repeating table/field but I did not find anything.  Maybe you know how to do this.

Anways, I'd bet that the infopath team will help you with your problem shortly.

Nick H

# July 21, 2009 5:06 PM

infopath said:

Hi fraygos,

Unfortunately there is no out of the box way to promote a column as Person/Group or bind to an existing column as Person/Group. However, what I have done to get this to work is to use SharePoint Designer to add a workflow to the library where I have created my Person/Group column and then use the workflow to set the value of my Person/Group column to the "AccountId" field that I promoted from my InfoPath form.

I hope this helps!

Scott

# July 21, 2009 5:24 PM

Nick H said:

^That helped me a lot Scott.  Thanks.

Nick H

# July 24, 2009 1:54 PM

mat1583 said:

I have found 2 roadblocks to using the InfoPath Contact Selector in browser-based forms. These seem to be bugs...

1)In both Safari and Firefox 3.5, when the Contact Selector checks to make sure the name entered is in AD, it adds an empty user and then pops up a dialogue box to resolve the empty user. ex: " ; LastName, FirstName" (without quotes) is what is in the field. IE 7 and 8 do not do this.

2)In Safari, once you add a user, you are unable to delete that user. You can delete the user in FF and IE.

Are these reported bugs, and will they be resolved anytime soon? This is unacceptable behavior for the control. Our clients are not happy with it, and neither are we.

# August 14, 2009 12:40 PM

infopath said:

Hi mat1583,

Thank you for bringing these issues to our attention. I searched through prior support cases we have received and was unable to find where this behavior had been brought to our attention before. So the first thing I want to let you know is our product group was not aware of these behaviors.

I have been able to reproduce the behavior you describe in both Firefox and Safari and will be submitting these to the product group for review. However, I don't have a time frame on if/when this may be addressed.

Thanks again,

Scott

# August 19, 2009 11:32 AM

mat1583 said:

Thanks for the reply, Scott. I was able to workaround the 'can't delete' issue by adding a clear button which uses a rule to clear AccountID, DisplayName, AccountType and reset our user count (since we have validation to limit to only 1 user). Safari and FireFox together make up a third of our traffic, so the extra blank user problem could be pretty confusing for a lot of people. This post was EXTREMELY helpful for me, but it was a big disappointment to get this far and discover problems like this. Hopefully it will be resolved soon. I'd love to use it in other forms we're developing if it will function correctly in other major browsers.

# August 20, 2009 5:46 PM

infopath said:

Thanks mat1583 - I am glad you found this useful!

I have submitted this behavior to our product group so hopefully this is something we can look at for a future service pack.

Scott

# August 20, 2009 5:50 PM

minhasquier said:

Hi!

I'm working with an InfoPath form which must have some Contact Selector controls to validate users from the MOSS server's AD.

I've done all steps as they're explained in this post, but the contact selector does not validate any user, and when I try to search for users clicking on the "To" button, it could not search for them.

I've already tried to change server name with IP address in Context.xml, but still can't search or validate users.

What could be the cause of this problem?

Thanks in advance.

# August 26, 2009 3:02 AM

infopath said:

Hi minhasquier,

Can you verify that the node names in your data source are spelled correctly AND the capitalization matches what is in this post?

Scott

# August 26, 2009 8:15 AM

minhasquier said:

Hi Scott,

I've checked it. All the groups that I am using with contact selector have the same structure, including correct spelling and capitalization, as it's specified in the post.

# August 26, 2009 8:46 AM

infopath said:

Hi minhasquier,

Can you check and make sure you can successfully validate a user with the built-in "People Picker" control in SharePoint? Try these steps:

- Navigate to the same site you are trying to use with InfoPath

- From the Site Actions button, choose Site Settings and then choose People and Groups

- Click New

- Enter the same name in the Users/Groups box and click the "Check Names" button...does that user get validated?

If so, are you testing the control in the InfoPath client or in the browser? If you are not testing in the browser, please publish the XSN to you site, open a new instance of the form in the browser and what are the results of the control here?

Scott

# August 26, 2009 9:33 AM
Anonymous comments are disabled
Page view tracker