Hi everyone,
i have a repeating table which contains a checkbox. The structure is
activitylogs(group)-> activityLog(repeating table)-> ongoing (checkbox)
I want to dynamically insert new row and assign the checkbox a value according to another filed value.
I managed to insert the checkbox, but every time I assigned a value to the check box, I got an error.
The error message says
System.InvalidOperationException
Schema validation found non-data type errors.
I googled around and applied the DeleteNil function but still no luck.
In the infopath designer, the datatype of the check box is True/False (boolean), value is FALSE when cleared and TRUE when checked
The above is my code
XmlDocument doc = new XmlDocument();
XmlNode group = doc.CreateElement("my:activityLog", NamespaceManager.LookupNamespace("my"));
XmlNode field = doc.CreateElement("my:ongoing", NamespaceManager.LookupNamespace("my"));
XmlNode node = group.AppendChild(field);
node.InnerText = "TRUE";
doc.AppendChild(group);
XPathNavigator node2 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:activityLogs", NamespaceManager);
DeleteNil(node2);
node2.AppendChild(doc.DocumentElement.CreateNavigator());
Please help me out. Many Thanks!