Contact Selector working in one form and not another - InfoPath Dev
in

InfoPath Dev

Contact Selector working in one form and not another

Last post 09-16-2013 08:24 AM by j-red. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-13-2013 02:40 PM

    • j-red
    • Not Ranked
    • Joined on 09-10-2013
    • Posts 5

    Contact Selector working in one form and not another

    Hi I have a form with a working Contact selector. It's main datasource was a submit to web service.

    However I wanted to return the ID of the record just entered for use in a workflow so I created a new form with a retrieve from web service datasource and the contact selector stopped working.

    I can search, but when I try and add the user the field is greyed out.

    I have readded the custom contact selector control exactly the same way, I have recreated the Context datasource (they both use the same file) and the fields are exactly the same (no spelling mistake).

    The only difference is that in the original submit form the fields are editable and the datasource is submit:

    http://imgur.com/MJ6MNHF

    and in the new form the fields are not editable and the datasource is retrieve.

    http://imgur.com/XyLoBBL

    I have even tried saving the form as source and changing the manifest file to make the fields editable (then opened the manifest in a new form) and it still didn't work when the fields were editable.

    Could it be the datasource type (submit vs receive)? Or the fact that it's under three extra levels of folders? Or something else?

    Any ideas?

  • 09-13-2013 04:16 PM In reply to

    Re: Contact Selector working in one form and not another

     I'm guessing that you had your cursor in a section bound to the query fields when you added the contact selector. You don't want it in the query fields. Your first screenshot shows a form with an editable schema - your second shows a form that appears to have been created from another data source - a web service maybe?

    Hilary Stoupa

  • 09-16-2013 06:58 AM In reply to

    • j-red
    • Not Ranked
    • Joined on 09-10-2013
    • Posts 5

    Re: Contact Selector working in one form and not another

    Hi Hilary,

    I have tested this a few different ways:

    1) New form from blank, I added only a contact selector and it worked.

    2) New form from web service, I added only a contact selector to the web service operation, it didn't work.

    3) I saved the web service form as source, edited the manifest to make all the fields editable and opened up that schema in a new blank form, it didn't work.

    The only difference between the 1) and 3) now are the names of the fields, with 1) having my: prefix/namespaces and 3) having s: and tns: prefix/namespaces. Neither of them are connected to a datasource.

    This is the schema for 1) (The working one):

    <my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-09-16T14:33:37" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"> <my:dataFields> <my:ContactTest> <my:TContactTest> <my:Requestor> <my:Person> <my:DisplayName/> <my:AccountId/> <my:AccountType/> </my:Person> </my:Requestor> </my:TContactTest> </my:ContactTest> </my:dataFields> <xd:SchemaInfo LocalName="myFields" NamespaceURI="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-09-16T14:33:37"> <xd:Namespaces> <xd:Namespace LocalName="myFields" NamespaceURI="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-09-16T14:33:37"/> </xd:Namespaces> </xd:SchemaInfo> <xd:DataConnection Name="Context"> <Context siteUrl="" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-09-16T14:33:37" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"> <xd:SchemaInfo LocalName="Context" NamespaceURI=""> <xd:Namespaces> <xd:Namespace LocalName="Context" NamespaceURI=""/> </xd:Namespaces> </xd:SchemaInfo> </Context> </xd:DataConnection> </my:myFields>

    And this is the schema for 3) (The not working one)

    <dfs:myFields xmlns:ns1="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-09-16T14:34:54" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://tempuri.org/" xmlns:s1="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-08-29T14:31:03" xmlns:s2="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-08-12T19:02:25" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-09-16T14:45:00" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"> <dfs:dataFields> <tns:ContactTest> <s1:TContactTest> <s1:Requestor> <s1:Person> <s1:DisplayName/> <s1:AccountId/> <s1:AccountType/> </s1:Person> </s1:Requestor> </s1:TContactTest> </tns:ContactTest> </dfs:dataFields> <xd:SchemaInfo LocalName="myFields" NamespaceURI="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"> <xd:Namespaces> <xd:Namespace LocalName="myFields" NamespaceURI="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"/> </xd:Namespaces> </xd:SchemaInfo> <xd:DataConnection Name="Context"> <Context siteUrl="" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-09-16T14:45:00" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"> <xd:SchemaInfo LocalName="Context" NamespaceURI=""> <xd:Namespaces> <xd:Namespace LocalName="Context" NamespaceURI=""/> </xd:Namespaces> </xd:SchemaInfo> </Context> </xd:DataConnection> </dfs:myFields>

    Sorry I can't get the spacing to work in the forum...

    It seems to me that the contact selector simply NEEDS the myXSD namespace and can't handle the dataform namespace that the web service requires.

  • 09-16-2013 08:24 AM In reply to

    • j-red
    • Not Ranked
    • Joined on 09-10-2013
    • Posts 5

    Re: Contact Selector working in one form and not another

    Basically, a contact selector only seems to work inside the <my:> namespace.

    I have moved it out of my web service section of the schema into a new <my:> section and it works again. However I still need to find a way to pass this section into my web service with the rest of the XML data.

    I'll probably have to create a separate datasource and web service operation to write the contact data after the initial call. Not the cleanest way, but it should work.

    EDIT:

    Actually, is there a way to set up a retrieve datasource while only using the <my:> namespace? I can do it with submit but every time I try with retrieve it creates a secondary datasource with the web service's namespaces, it will never use my custom schema.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.