Archive

Archive for December, 2011

SharePoint 2010: List Fields not showing up in Edit, Display or New Forms

December 28, 2011 1 comment

I have seen a lot of people get stuck on this issue.

Look at the CAML markup in the list definition’s Schema.xml file below (this was auto-generated by the Visual Studio SharePoint ‘List Definition’ template selecting Custom List as the list type):

<List xmlns:ows="Microsoft SharePoint" Title="Custom List" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/ACustomList" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
  <MetaData>
    <ContentTypes>
      <ContentTypeRef ID="0x01">
        <Folder TargetName="Item" />
      </ContentTypeRef>
    </ContentTypes>
    <Fields>
      <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="Title" Required="TRUE" StaticName="Title" FromBaseType="TRUE" />
      <Field ID="{AACF7B24-80FC-4EB6-8C73-381626D056C6}" Name="Value" StaticName="Value" Type="Note" DisplayName="Value" NumLines="6" RichText="TRUE" />
    </Fields>
......
.............

Looking at the list definition you would assume that the edit, display and new forms would display two fields (Title and Value) but in actual fact it only displays the Title field.

The reason for this is that in the markup we have specified that the list uses the Item (0×01) content type but the additional field is not part of that content type hence it does not appear in the forms.

To ensure they appear we either need to:

  • Remove the content type reference from the markup
  • Or we could create a new content type that inherits from the Item content type and include this additional field as part of its definition. We can then reference that content type in our list definition instead of the Item content type.

Other reasons that might cause your fields to not appear in edit, new and/or display forms of your list could be:

  • Field’s ShowInEditForm, ShowInDisplayForm, ShowInNewForm attributes are set to FALSE
  • Field is Hidden
  • Field is set as ReadOnly
    • Please note that this is not an exhaustive list. Hope this helps someone.

SharePoint 2010 Login issue only using IE (Internet Explorer) on an FBA enabled Site

December 27, 2011 Leave a comment

Recently I bought a new laptop (OS: Windows 7 Professional). Using IE9 I opened up one of our SharePoint 2010 sites and tried to login and it just refreshed the login page with no error messages displayed. Using IE9 on my old laptop had never caused this issue.

I searched a lot on the interwebs to see if other people had encountered this issue and I found a lot of people in a similar situation but all the suggestions I found to solve this issue a) did not work for me, b) were unacceptable in any case. They included suggestions like adding the site as a trusted site and then making x,y and z changes to your browser settings.

One of our SharePoint 2010 site is a public facing site where people register and can gain access to the site. Imagine telling those 1000′s of users you need to make x,y,z changes to your browser settings in order to gain access to our site.

What I noticed was that I was having this issue when I clicked on the “remember me” checkbox on the login page (selecting this option issues a persistent cookie). If I did not check this option then I was able to login without any problems.

To cut a long story short, by a complete freak accident, I was able to fix this issue by making a small change in the web.config of the Web Application. If your site uses Claims Based Authentication you will see the following section in your web.config file:

 <microsoft.identityModel>
    <service saveBootstrapTokens="true">
      <audienceUris />
      <issuerNameRegistry type="Microsoft.SharePoint.IdentityModel.SPPassiveIssuerNameRegistry, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <securityTokenHandlers>
        <clear />
        <add type="Microsoft.IdentityModel.Tokens.X509SecurityTokenHandler, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add type="Microsoft.SharePoint.IdentityModel.SPSaml11SecurityTokenHandler, Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
          <samlSecurityTokenRequirement>
            <nameClaimType value="http://schemas.microsoft.com/sharepoint/2009/08/claims/userid" />
          </samlSecurityTokenRequirement>
        </add>
        <add type="Microsoft.SharePoint.IdentityModel.SPTokenCache, Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </securityTokenHandlers>
      <federatedAuthentication>
        <wsFederation passiveRedirectEnabled="false" issuer="https://none" realm="https://none" />
        <cookieHandler mode="Custom" path="/" >
          <customCookieHandler type="Microsoft.SharePoint.IdentityModel.SPChunkedCookieHandler, Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        </cookieHandler>
      </federatedAuthentication>
    </service>
  </microsoft.identityModel>

I made the following change (persistentSessionLifetime=”60″):

<cookieHandler mode="Custom" path="/" persistentSessionLifetime="60">

I am not sure why but this fixed the issue for me.

Hope this helps someone else.

Follow

Get every new post delivered to your Inbox.