An unexpected error has occurred.

Feb 16, 2011 at 2:47 PM

Hi,

I've enhanced NewForm.aspx with $().SPServices.SPCascadeDropdowns and $().SPServices.SPDisplayRelatedInfo functions. I've added this piece of code right after <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">. My code:

<script language="javascript" type="text/javascript" src="../../jQuery/jquery-1.4.4.min.js"></script>
<script language="javascript" type="text/javascript" src="../../jQuery/jquery.SPServices-0.5.8.min.js"></script>
<script language="javascript" type="text/javascript">

	$(document).ready(function() {
	
		$().SPServices.SPCascadeDropdowns({
			relationshipList: "Region Report Name",
			relationshipListParentColumn: "Title",
			relationshipListChildColumn: "ReportName",
			parentColumn: "Region",
			childColumn: "Report Name",
			debug: true
		});
		
		$().SPServices.SPCascadeDropdowns({
			relationshipList: "Report List",
			relationshipListParentColumn: "ReportName",
			relationshipListChildColumn: "ReportVersion",
			parentColumn: "Report Name",
			childColumn: "Report Version",
			debug: true
		});

		$().SPServices.SPCascadeDropdowns({
			relationshipList: "Region Category",
			relationshipListParentColumn: "Region",
			relationshipListChildColumn: "Title",
			parentColumn: "Region",
			childColumn: "Issue Category",
			debug: true
		}); 	

		$().SPServices.SPCascadeDropdowns({
			relationshipList: "Issue Category Type",
			relationshipListParentColumn: "Category",
			relationshipListChildColumn: "Title",
			parentColumn: "Issue Category",
			childColumn: "Issue Category Type",
			debug: true
		});	

		$().SPServices.SPDisplayRelatedInfo({
			columnName: "Issue Category Type",
			relatedList: "Issue Category Type",
			relatedListColumn: "Title",
			relatedColumns: ["Notes"],
			debug: true
		});
	
	});
	
</script>

all works fine, bit slow (as report list contain around 500 rows), but fine. However, in moment when I want to submit form I receive An unexpected error has occurred.
Troubleshoot issues with Windows SharePoint Services. Error. I\ve tried also to put script into CEWP instead of adding it directly to form with same results.

When I remove code everything works fine again and I am able to submit new item.

I've tried to isolate when issue occures and when not. When I've used just $().SPServices.SPDisplayRelatedInfo function I was able to submit form without issue. When I've used  $().SPServices.SPCascadeDropdowns function I was still getting error. Is there problem with my list size? What are SPServices limitations?

 

Thank you,

m.

Coordinator
Feb 16, 2011 at 5:41 PM

Your code looks OK (assuming I'm not missing a comma omission or something).

Try commenting out the calls and testing them one at a time. My guess is that one of the columns in your relationship lists isn't a Lookup column to the same thing as the column in your current list. That would potentially give you a value (or values) that are incompatible, which would cause that error.

M.

Feb 23, 2011 at 7:47 PM

Hi Marc,

my bad, I found reason of error. Code looks OK, but it is mixed up bit, let me explain.

I have following collums filtered in cascade:

Region > Report Name > Report Version which is correct, but here comes my mistake I am using alredy selected Region dropdown to filter Region > Issue Category > Issue Category Type and display related info. Funny thing dropdowns are filtered correctly. However when you try to submit form it ends up with error. Removing Region filter option from Issue Category > Issue Category Type help to resolve this issue.

Thank you for great jQuery library,

Regards

m.

Coordinator
Feb 23, 2011 at 9:30 PM

Glad you got it figured out!

M.