Controls loading as "Cannot be Blank"

P

Paul

I have an InfoPath template with a repeating section containing three
controls. Once an xml file is created using this template, I would like to
load the data from this repeating group of controls into a new template. The
new template repeats the same three controls but contains additonal controls
(2 rich text boxes, 1 check box, and 1 date picker). I can load the data from
the xml file just fine however the check box and date picker loading as
"cannot be blank" even though they are not defined that way in the template.

This is the code I am using to load the data:

nodeSecondaryData =
rootSecondaryData.Select("/ns4:MainDataSource/ns4:Matrix/ns4:OptionalFeatures/ns4:Requirement", NamespaceManager)

Do While nodeSecondaryData.MoveNext
Using writerMainData As XmlWriter =
MainDataSource.CreateNavigator().SelectSingleNode("/my:MainDataSource/my:SystemQualificationTesting/my:OptionalFeatures", NamespaceManager).AppendChild()
With writerMainData
.WriteStartElement("RequirementTested", myNamespace)
.WriteElementString("Title", myNamespace,
CheckString(nodeSecondaryData.Current.SelectSingleNode("ns4:Title",
NamespaceManager)))
.WriteElementString("Description", myNamespace,
CheckString(nodeSecondaryData.Current.SelectSingleNode("ns4:Description",
NamespaceManager)))
.WriteElementString("Measurement", myNamespace,
CheckString(nodeSecondaryData.Current.SelectSingleNode("ns4:Measurement",
NamespaceManager)))
.WriteElementString("TestDescription", myNamespace, Nothing)
.WriteElementString("RequirementFulfilled", myNamespace,
Nothing)
.WriteElementString("DemonstratedOn", myNamespace, Nothing)
.WriteElementString("Responsible", myNamespace, Nothing)
.WriteEndElement()
.Close()
End With
End Using
Loop

How can I stop this behavior?

Thanks
 
S

Swathi

Set the xsi:nil value to true for the check box and date picker fields.

Hope this helps you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top