Schema validating found non-data type errors
In order to remove the nil attribute from a date picker control add the following code:
Dim mainDS As XPathNavigator = MainDataSource.CreateNavigator
Dim StartDate As XPathNavigator = mainDS.SelectSingleNode("/my: myFields/my:StartDate", NamespaceManager)
If StartDate.MoveToAttribute(" nil", NamespaceManager. LookupNamespace("xsi")) Then
StartDate.DeleteSelf()
End If
StartDate.SetValue("2012-10- 08")
The following InfoPath controls typically have nil attributes on the fields they are bound to:
- Text Box with the Whole Number (integer) data type
- Text Box with the Decimal (double) data type
- Text Box with the Time (time) data type
- Date Picker
- Date and Time Picker
- File Attachment
- Picture (when a picture is included in the form instead of as a link)
- Ink Pickture
You can find out whether a control supports the nil attribute by adding a control to the form template, previewing the form, leaving the control empty, saving the form locally on disk, opening the XML file for the form in Notepad, and then looking for:
xsi:nil="true"
No comments:
Post a Comment