Monday 20 January 2014

“Infopath cannot generate a form template for Sharepoint list form. Missing equals sign between attribute and attribute value” on InfoPath 2010

At some point when you have tried to use a Custom List created by yourself and edited with Infopath 2010 you could end getting this error message.

“Infopath cannot generate a form template for Sharepoint list form. Missing equals sign between attribute and attribute value”

This error message comes directly from the Content Type.

Go To Visual Studio 2010/2012/2013 and be sure that the name of the field doesn’t contain any spaces.

So instead of having this in your column definition:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field
       ID="{c6797d94-d297-4142-917c-149234839128}"
       Name="Security of Tenure"
       DisplayName="Security of Tenure"
       Type="Boolean"
       Required="FALSE"
       Group="Custom Site Columns">
  </Field>
</Elements>


You Should have:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field
       ID="{c6797d94-d297-4142-917c-149234839128}"
       Name="SecurityofTenure"
       DisplayName="Security of Tenure"
       Type="Boolean"
       Required="FALSE"
       Group="Custom Site Columns">
  </Field>
</Elements>


And Instead of having this in your Content Type:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x0100298A36AB7ABB4C59B91FA2D8F92589D3" MyUnit" Group="Custom Content Types" Description="Unit Content Type" Inherits="TRUE" Version="0">
    <FieldRefs>
      <FieldRef ID="{c6797d94-d297-4142-917c-149234839128}" DisplayName="Security of Tenure" Required="FALSE" Name="Security of Tenure" />
    </FieldRefs>
  </ContentType>
</Elements>
You should have:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x0100298A36AB7ABB4C59B91FA2D8F92589D3" MyUnit" Group="Custom Content Types" Description="Unit Content Type" Inherits="TRUE" Version="0">
    <FieldRefs>
      <FieldRef ID="{c6797d94-d297-4142-917c-149234839128}" DisplayName="Security of Tenure" Required="FALSE" Name="SecurityofTenure" />
    </FieldRefs>
  </ContentType>
</Elements>
Enjoy!