File attachment fields are always required

I

iconomie

Hello,

I got a problem on creating a form, based on a .xsd file which I got from a
webservice.
The .xsd schema contains several fields for PDF attachment. Some of them are
required fields and some are optional. My Problem is that Infopath treats
every attachment filed from this xsd file as required despite it's xsd
element is marked with 'minOccurs="0"'.
I tried to edit the datasource options and unset the mark at "cannot be left
blank" but Infopath disables the datasource editing.
Can anybody give me a hint to solve this problem?

I really need a form with several optional attachment fields.
best regards
iconomie
 
K

Kalyan Reddy

You cannot edit the UI fields in the datasource for the outside schemas

Open the schema.xsd and the field should be marked as 'nillable="true".Its
not depended on 'minOccurs="0"'.

and also check that in the Template.xml field should be set as
'xsi:nil="true"

Hope this helps you
 
I

iconomie

Thank you very much for your fast reply!
That seems to work!
But now there is another problem:

It doesn't seem to work for all fields.
I got two different complexTypes for the attachment fields called "document"
and "documentData":
-----
<xsd:complexType name="documentData">
<xsd:simpleContent>
<xsd:restriction base="xmime:base64Binary">
<xsd:attribute ref="xmime:contentType" use="optional"
default="application/pdf"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
-----
<xsd:complexType name="document">
<xsd:all>
<xsd:element name="date" type="xsd:date">
</xsd:element>
<xsd:element name="document" type="qw:documentData">
</xsd:element>
</xsd:all>
</xsd:complexType>
-----

One of the optional attachment fields uses the complexType "documentData":
<xsd:element name="confirmation" type="qw:documentData" nillable="true"
minOccurs="0">
Here Infopath treats the attachment field as an optional one. Works fine
here.

Another optional field uses the complexType "document":
<xsd:element name="federation" type="qw:document" nillable="true"
minOccurs="0">
Here Infopath seems to ignore 'nillable="true"' and treats the date and
attachment fields as required.

Can anyone help me out?
best regards
iconomie
 

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