SPCascadeDropdowns and content types...problem on submit

Jan 14, 2011 at 11:06 PM
Edited Jan 14, 2011 at 11:11 PM

I'm very new to jQuery and these forums (1st day), so please be patient.  : )

 

I have a list in which I have created a new Content Type to display only a few fields from the list required to start a workflow.  I pasted the following into a CEWP (yes, I am aware that you prefer not to do this, and no, I haven't tried to place the code straight into the form via SPDesigner):



 

<script type="text/javascript">

$(document).ready(function() {

 $().SPServices.SPCascadeDropdowns({

relationshipList: "{3DC292C9-E366-4A36-A0C6-8381701B6B7C}",

relationshipListParentColumn: "Title",

relationshipListChildColumn: "Project_x0020_Leader",

parentColumn: "System",

childColumn: "Project Leader",

debug: false });

}); 

</script>

  

If I put all the items on the NewForm.aspx and do not use another content type, the lookup works perfectly. If I switch the New button on the list to use the new content type with only a subset of all the fields, I get a cryptic error: "An unexpected error has occurred. Troubleshoot issues with Windows SharePoint Services."
Checked the Event Logs and found Windows SharePoint Search wasn't running, started that and still get the same issue.

Are the content types causing confusion in the JS?

If you use different content types all the time and have never seen this before or think it's just a SP config problem, please let me know. I have spent all day on the issue and I would appreciate any assistance or just a point in the right direction to debug the problem myself.

Thanks in advance, Jason Sheats 

Coordinator
Jan 15, 2011 at 4:30 AM
Don't be afraid. ;-) Does the error occur on page load or on submit? Either way, I don't *think* it's an error caused by SPServices. What I would try is going back to the form as it initially was and see if you can get things running without SPServices and then add it back in. Also, you don't show any reference to the .js files, but that may simply be an omission. M.
Jan 18, 2011 at 3:48 PM
Edited Jan 18, 2011 at 5:02 PM
M,
 
Thanks for the reply.
 
It happens in the submit when I click the OK button. I do have the .js files included. No submit is even attempted by the page. It's like the validation is hosed. I don't see an error in the event log either.
 
 
<script src="http://server1.com/Jquery/jquery-1.4.2.min.js" type="text/javascript"> </script>
 
<script src="http://server2.com/Jquery/jquery.SPServices-0.5.6.min.js" type="text/javascript"> </script>
<script type="text/javascript">
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
relationshipList: "{3DC292C9-E366-4A36-A0C6-8381701B6B7C}",
relationshipListParentColumn: "Title",
relationshipListChildColumn: "Project_x0020_Leader",
parentColumn: "System",
childColumn: "Project Leader",
debug: false
});
});
</script>
Coordinator
Jan 19, 2011 at 4:32 AM
Edited Jan 24, 2011 at 1:44 AM

I'm not sure that I fully understand what you're explaining you're doing with the Content Types. Can you try again to see if you can get it through my thick head?

And did you try taking out the script altogether? Does everything work OK without it?

M.

Jan 22, 2011 at 12:15 PM

One small suggestion would be to ensure that you are using all required fields in your content type or that there are no required fields set. The changing of the content type on the page does modify the page so if you do as Marc suggested, you could remove the content type and see what the page is rendering with everything working and then add it back to what changes in the rendered page.