Schema validation found non-data type error - InfoPath Dev
in

InfoPath Dev

Schema validation found non-data type error

Last post 01-19-2009 07:33 AM by Shiva. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-17-2009 03:07 PM

    Schema validation found non-data type error

     Hello.

     I have created an InfoPath form that has 4 dropdowns on it.  3 of the dropdowns (Location, Area and Type) allow me to query a SharePoint List and create an SPListItemCollection that contains Questions from the List.  The 3 dropdowns filter the 4th dropdown which contains questions.

    This part works fine but I want to populate the SPListItemCollection values from the List into the 4th dropdown on the InfoPath form.

    In my code as follows the PopulateQuestions generates the list of questions from a CAML query in that function.  This works correctly and returns my list items based on the items selected in the Location, Area and Type dropdowns.

    The code fails with an error "Schema validation found non-data type" error but this is a Dropdown List on the form that I am trying to populate with a data type of string.

    What is the correct way to populate the dropdown programmatically from an SPListItemCollection?

     

    Here is my code:

    try
                {
                    //CALL THE FUNCTION TO POPULATE THE QUESTIONS OBJECT
                    SPListItemCollection questions = PopulateQuestions(nodeLocation.Value.ToString(), nodeArea.Value.ToString(), nodeType.Value.ToString());
                   
                    //FILL THE QUESTIONS DROPDOWN WITH THE DATA RETURNED
                    if (questions != null)
                    {
                        foreach (SPListItem ListItem in questions)
                        {                       

                            nodeQClone = nodetQuestionList.Clone();
                            nodeQClone.SelectSingleNode("/my:dc/my:dcquestion", NamespaceManager ).SetValue(Convert.ToString(ListItem["Title"]));

                            //CODE FAILS AT NEXT LINE                      
                           nodeAuditQuestionList.InsertAfter(nodeQClone);
                           
                            if (questions.Count > 0)
                                //DELETE THE PARENT NODE TO REMOVE DUPLICATE ENTRY
                                nodetQuestionList.DeleteSelf();                                            
                        }

                    }
                }
                catch (Exception ex)
                {

                }

  • 01-19-2009 07:33 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Schema validation found non-data type error

    Hello,

    You have to check the below nodes structure is same in template.xml,

    nodeAuditQuestionList

    nodeQClone

    If the above nodes are same as template.xml otherwise it will give error.

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