SPCascadeDropdowns - relationshipListParentColumn

Dec 6, 2011 at 8:08 PM

The function sometimes acts strangely.

I've tried to do a dropdown, and I get the following error:

Error in function

SPServices.SPCascadeDropdowns
Parameter
relationshipListParentColumn: Division or relationshipListChildColumn: Subdivision
Message
Not found in relationshipList 01.02 - Subdivisions

My code:

	// Set up the cascade from Division to Subdivision
	$().SPServices.SPCascadeDropdowns({
		relationshipList: "01.02 - Subdivisions",
		relationshipListParentColumn: "Division",
		relationshipListChildColumn: "Subdivision",
		relationshipListSortColumn: "ListSort",
		parentColumn: "Division",
		childColumn: "Subdivision",
		simpleChild: true,
		debug: true
	});

And I've seen my list, and I have Division and Subdivision in my list (01.02 - Subdivisions)

What is going wrong?

Thanks!

Coordinator
Dec 8, 2011 at 1:36 PM

That error is telling you that one of the column names you are using is incorrect or that it isn't found in the list. Check to make sure that you are using the InternalName and not the DisplayName. My guess is that the SubDivision column is actually the Title.

M.

Dec 8, 2011 at 4:55 PM
sympmarc wrote:

That error is telling you that one of the column names you are using is incorrect or that it isn't found in the list. Check to make sure that you are using the InternalName and not the DisplayName. My guess is that the SubDivision column is actually the Title.

M.

Hi Marc,

Everything went fine! Even the relationshipListSortColumn worked for my dropdown. But I couldn't get that for the first dropdown. Could I use in a way your function to do that?

Thanks!

Coordinator
Dec 8, 2011 at 5:00 PM

I'm not sure what you mean. Something about the column names you are using isn't right.

M.

Dec 8, 2011 at 5:07 PM
sympmarc wrote:

I'm not sure what you mean. Something about the column names you are using isn't right.

M.

Parent:

List Country
1 ALL

2 Aaa

3 Abb

 

 

Child

List City

1 ALL

2 Aaa

3 Abb

 

relationshipListSortColumn: "List",

This line will work for the Child dropdown, but not for the parent. Is there a way to order this list too?

Thanks.

Coordinator
Dec 8, 2011 at 5:12 PM

You should be able to use SPFilterDropdown to sort the parent column.

M.

Dec 8, 2011 at 5:53 PM
sympmarc wrote:

You should be able to use SPFilterDropdown to sort the parent column.

M.

Here is my code:

$().SPServices.SPFilterDropdown({
		relationshipList: "{a55b6d44-8610-4846-b7e3-db9e1befb120}",
		relationshipListColumn: "Title",
  		relationshipListSortColumn: "List",
 		debug: true
});

And then I get this error:

Error in function
SPServices.SPFilterDropdown
Parameter
relationshipListColumn: Title
Message
Not found in relationshipList {a55b6d44-8610-4846-b7e3-db9e1befb120} - or CAML is incorrect

The List is a numerical table, and has 1, 2, 3, 4 as values.

 

Thanks for your patience :)

Dec 8, 2011 at 8:43 PM
Edited Dec 9, 2011 at 9:44 AM

Ok, I did finally find a solution that works for the ordering:

 

$().SPServices.SPFilterDropdown({
		relationshipList: "{a55b6d44-8610-4846-b7e3-db9e1befb120}",
		relationshipListColumn: "Title",
  		relationshipListSortColumn: "List",
  		columnName: "Cluster",
  		CAMLQuery: "<Eq><FieldRef Name='Valid' /><Value Type='Integer'>1</Value></Eq>",
 		debug: true
});

It does show the ordering that I want when I open the drop down, but the value that it shows first when I finish loading the page, is the one in alphabetical order. Example: it shows in the drop down Aaa instead of having ALL, but when I open the drop down, I have ALL then Aaa.

I also discovered an other issue with an other function:

 

$().SPServices.SPComplexToSimpleDropdown({
	columnName: "Country"
});

 

The function works perfectly for doing the change, but if I leave the default value and click save, he will ask me to enter a value (You must specify a value for this required field). The turn-around for this one, is to use SPFilterDropdown, but it's like using a tank for a nail.

Thanks for any help provided or suggestion :)