In order to remove the "Cannot be blank" option, you will need to manually
modify the schema. As such, before you complete these steps please be sure
you have a backup copy of your XSN file! :-)
- Create a folder on your machine to store the InfoPath files
- Open your XSN in Design View
- From the File menu, choose Extract Form Files and choose the folder you
created above
- Now, depending on how your web service is designed you will probably have
multiple "XSD" files in this folder. You will need to open each, with say
Notepad, until you locate the schema that documents the various
attributes/elements for each field. For instance, in my sample that is
based on a web service returning three tables "schema3.xsd" is the one that
documents the "type", "minOccurs", etc.
- Once you find the appropriate schema, locate (for now) just one of the
date fields - for instance mine appeared as:
<xs:element name="OrderDate" type="xs:dateTime" minOccurs="0"/>
- You will need to add the "nillable" attribute to this element - such as:
<xs:element name="OrderDate" type="xs:dateTime" minOccurs="0"
nillable="true"/>
- Save and close the schema
- Right-click on Manifest.XSF and choose Design
- Click the Preview button - if you completed the modification correctly,
that date field should no longer contain a red asterisk!
- Complete the same steps for the other fields
I hope this helps!
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
That's great to hear!
To get back to a deployable XSN:
- Right-click on Manifest.XSF and choose Design
- From the File menu choose Save As (you will see in the File Type the only
option is XSN)
- Re-save to your XSN (again...assuming you have a backup!)
Let me know if you need anything else...
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
"Scott L. Heim [MSFT]" wrote:
I'm VERY GLAD to see that I'm not alone to think that that's a pitty that we
have to deal with the schema and modifying it by hand (with all the risks we
all know) while we are using InfoPath, Web services and Strongly Typed
Datasets....
Thanks Scott for your answer because this was missing to some of our projects.
Is there some news reagarding that with the 2007 version (or is it by hand
as well?)?
Thanks.
Fred