locked
What is wrong with this field definition? RRS feed

  • Question

  • This is part of a list definition schema. WHen I try to provision a new list, I get an error when I go to AllItems.aspx page for that list. Thank you!

    <Field ID="{2a9ab6d3-268a-4c1c-9897-e5f018f87e64}" Filterable="FALSE" Type="Computed" Name="TeamMemberwMenu" DisplayName="Team Member" DisplayNameSrcField="Team Member" ClassInfo="Menu" AuthoringInfo="TeamMemberwEditMenu" ListItemMenuAllowed="Required" LinkToItemAllowed="Prohibited" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="TeamMemberwMenu">
            <FieldRefs>
              <FieldRef Name="TeamMember" />
              <FieldRef  Name="Custom_x0020_Order" />
              <FieldRef Name="FileLeafRef" />
              <FieldRef Name="FileRef" />
              <FieldRef Name="FSObjType" />
              <FieldRef Name="_EditMenuTableStart2" />
              <FieldRef Name="_EditMenuTableEnd" />
            </FieldRefs>
          </Field>


    When I go to AllItems.aspx page, I notice below error in ULS logs.

    Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.    
     at Microsoft.SharePoint.JSGrid.SPGridSerializerGenerator.IsReadOnlyField(SPField field)    
     at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.AddInFieldSchemaForIPE(SPList list, XmlNode fieldRefNode, SPField field)    
     at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.AddInFieldSchema(XmlNodeList fieldRefNodes, SPList list)    
     at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.AddInTypeInfoIntoViewXml(XmlNode viewXml)    
     at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.ModifyXsltArgumentList(ArgumentClassWrapper argList)    
     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform) 




    • Edited by diffident Wednesday, May 21, 2014 10:32 PM
    Wednesday, May 21, 2014 10:25 PM

Answers

  • Turned out problem was something else. DisplayNameSrcField attribute was pointing to a wrong field.
    • Marked as answer by diffident Thursday, June 5, 2014 7:19 PM
    Thursday, June 5, 2014 7:19 PM

All replies

  • Can you try removing the following field refs and try again.

    	<FieldRef Name="FileLeafRef" />
              <FieldRef Name="FileRef" />
              <FieldRef Name="FSObjType" />


    --Cheers

    Thursday, May 22, 2014 6:56 AM
  • Hi

    According to your description, I suggest you create a simple demo with a few fields first. If the demo works, then you can add more fields one by one.

    By doing this, it will be easier to find out the root cause of this error.

    A detailed article about creating SharePoint List Definition:

    http://msdn.microsoft.com/en-us/library/gg276355(v=office.14).aspx

    More information about SharePoint Schema:

    http://msdn.microsoft.com/en-us/library/office/ms459356(v=office.14).aspx

    Thanks

    Patrick Liang

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com



    Patrick Liang
    TechNet Community Support

    Thursday, May 22, 2014 9:32 AM
  • Can you try removing the following field refs and try again.

    	<FieldRef Name="FileLeafRef" />
              <FieldRef Name="FileRef" />
              <FieldRef Name="FSObjType" />


    --Cheers


    No luck even after removing the field refs. Any other pointers?
    Thursday, May 22, 2014 2:28 PM
  • I copy/pasted this list definition from SP 2010 to SP 2013. Do I need to generate new GUIDs for all the fields? Is that the problem?
    Thursday, May 22, 2014 2:54 PM
  • Hi,

    What if you create a simple demo and then add other customization gradually? it will be easier to find out the root cause of the error.

    Best regards


    Patrick Liang
    TechNet Community Support

    Friday, May 23, 2014 10:03 AM
  • Turned out problem was something else. DisplayNameSrcField attribute was pointing to a wrong field.
    • Marked as answer by diffident Thursday, June 5, 2014 7:19 PM
    Thursday, June 5, 2014 7:19 PM