Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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>
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.