Cascade Dropdown Cross-Site Lookup

Mar 13, 2012 at 1:03 PM

I managed to set up a cascade dropdown for 2 lookup fields: Category and Sub-Category. This works great when the 2 lists are on the same site as the form (document library EditForm). However, as different Doc Libs on different sites (at the same level) require the same 2 lookups it would be the obvious place to put the 2 lists at the parent level.

Currently, the 2 fields on my form are lookup fields pointing to the Categories and Sub-Categories lists. Don't know if this is correct, but it seems the only way to get the cascade dropdown to work. As far as I know I can't get these lookups to point to the lists outside of the current site.

I see the SPCascadeDropDowns syntax has a "relationshipWebURL" element to point to the relationship list, but I cannot get this to work.

So, basically I would like the 2 Categories and Sub-Categories lookup lists at the parent level with the forms at sub-site level referencing these to create the cascade dropdowns. Is this possible, and if so how?

Coordinator
Mar 13, 2012 at 1:46 PM

Paul:

You can definitely store the lists in another site, and that's what the relationshipWebURL option is for. To use the contents of lists in the root site as lookups, create a Site Column at the root that is the lookup and then use that column in your list.

M.

Mar 14, 2012 at 10:14 AM

Thanks for the quick response. I've created 2 Site Columns as suggested (Category Group and Sub-Category) and added these to my Document Library. Although the lookups work on their own, the SPCascadeDropdowns script keeps producing the following error: parentColumn: Category Group - Column not found on page. I have tried changing the column name but still get a similar error message.

My 2 lists are:
Categories: Main Category = Title field, Chapter
SubCategories: SubCategory = Title field, MainCat = lookup Title in Categories list

Document Library (EditForm.aspx) fields are:
Category Group (DisplayName)
Sub-Category (DisplayName)

My script is:
// Set up the cascade from Categories to SubCategories
 $().SPServices.SPCascadeDropdowns({
  relationshipWebURL: "/r/618/Lists",
  relationshipList: "SubCategories",
  relationshipListParentColumn: "MainCat",
  relationshipListChildColumn: "Title",
  relationshipListSortColumn: "Title",
  parentColumn: "Category Group",
  childColumn: "Sub-Category",
  debug: true
 });

Coordinator
Mar 14, 2012 at 12:33 PM

Check to make sure that the "Category Group" column is in fact spelled exactly that way. The function looks for the column with that exact DisplayName. Of course, it also has to be a dropdown on the page.

M.

Mar 6, 2013 at 4:12 PM
I have a quick question.

I have a list on a sub-site that has a site content type with all site columns. Can i add the SPCascadeDropdowns to my new & edit forms?
Mar 6, 2013 at 4:15 PM
I have a quick question.

I have a list on a sub-site that has a site content type with all site columns. Can i add the SPCascadeDropdowns to my new & edit forms?
Coordinator
Mar 7, 2013 at 2:46 PM
Can you be more specific? I think the answer is yes. Are you having an issue?

M.
Mar 7, 2013 at 2:52 PM
I created a content type and created several site columns and reusable workflows that are associated with it. I created a list in a sub-site and populated it with my content type. I would like to have the cascading dropdown used in the new & edit forms. With the site columns in the top site, can I still do that?
Coordinator
Mar 7, 2013 at 3:18 PM
As long as you provide the webURL, which tells the function which site contains the relationshipList. Check the docs.

M.
Mar 7, 2013 at 3:28 PM
I will do that. Thank you for the response.