1

I started trying to make myself a custom New Item form for a OOTB task list in SharePoint Server 2013 with the latest CU's.

I found that if my DataFormWebPart had the RelatedItems field present and accounted for (as is the default with Designer 2013), the form would not display ("Something went wrong").

I notice also that the OOTB NewForm.aspx does not include a related items field.

I'm here because I was extremely frustrated by my experience and was unable to find anything relevant on the googles. If anyone else has had this experience (or can replicate this behavior), please lend your advice. Hopefully we can come to a resolution.

EDIT: My workaround thus far has been to completely remove the RelatedItems field (see the code below). Just comment it out and the form will magically start working. As far as I can tell, RelatedItems works normally in the Edit and View forms.

The ULS log shows the following:

System.NullReferenceException: Object reference not set to an instance of an object.   
at Microsoft.SharePoint.RelatedItemsFieldControl.OnLoad(EventArgs e)    
at System.Web.UI.Control.LoadRecursive()    
at System.Web.UI.Control.LoadRecursive()    
at System.Web.UI.Control.AddedControl(Control control, Int32 index)    
at Microsoft.SharePoint.WebPartPages.WebPart.AddParsedSubObject(Object obj)    
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.CreateChildControls()    
at System.Web.UI.Control.EnsureChildControls()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean        includeStagesAfterAsyncPoint)

And the table row:

<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Related Items</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff10{$Pos}" ControlMode="New" FieldName="RelatedItems" __designer:bind="{ddwrt:DataBind('i',concat('ff10',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@RelatedItems')}"/>
<SharePoint:FieldDescription runat="server" id="ff10description{$Pos}" FieldName="RelatedItems" ControlMode="New"/>
</td>
</tr>
  • 1
    Any update on this? I have the same issue and I don't know how to resolve it. I didn't find anything in google. Thanks, Ruben – Ruben Mar 27 '17 at 15:09
  • @Ruben the workaround I detailed above is the only answer I'll ever get to this question. In the three years or so since I've posted this question I've stopped using or developing on SharePoint in disgust, favoring the many and superior alternatives out there for form building, tasks lists, document storage and sharing and databasing. SharePoint isn't worth the hassle to develop anything good on. – danthehat Mar 30 '17 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.