$().SPServices.SPCascadeDropdowns relationshipWebURL

Dec 9, 2009 at 5:59 PM

Hi Marc,

First of all amazing work, I think this is the most useful application I have seen on CodePlex for SharePoint Developpers. Really good work.

I have 2 questions:

1. If my relation ship lists are located at the Site Collection level, is there a way from subsites to acces them? I was looking at the relationshipWebURL parameter but it expects the Name of the Web or site. When I input the name of my site collection which is Home, it does not work. I should I go about this?

2. I have a relation Business Area --> Document Scope --> Document Type in Business Product Area 1 (BPA1) i have a Scope named Scope1 and Scope 1 also exists in BPA 2. Scope 1 in BPA1 has a set of Document Types and Scope 1 in BPA2 has another set of Document Types. Whenever I choose Either BPA1 or 1 and Scope1 i nget a list of all the Document Types for both Scope1s. Is there a way to go around this problem in your code?


Thank You very much

Dec 9, 2009 at 6:47 PM

1. Yes, the relationshipWebURL parameter is the right way to go, or use the list's GUID. relationshipWebURL should have a URL value, so something like: "/" or "/sitename".

2. You've lost me a bit on this one, but should you be using Content Types instead and then capturing the Business Area as a piece of metadata?


Dec 10, 2009 at 2:49 AM

Hi MArc,

The first Part I figured it out. I set the relationshipWebURL to " " and it gets the list from the root site.

As for the second part I know it's kind of complicated let me try to explain it better

List Business Area



List Scopes

Title Business Area

Scope1 BA1
Scope1 BA2

List Document Types:

Title Document Scope

DOcType1 Scope1 (BA1)
Doctype2 Scope1 (BA2) 


When the relationship is made between the list you select BA1 and Scope1 It should just give you DocType1 as a choice for document type, but it gives you both Doctype1 and doctype2


Also on a different subject I tried the AddNew Lookup item script on a Document library but the link that is built does not work its always http://Lists/lookuplistName/....  It is missing the Site Url.

Dec 10, 2009 at 12:57 PM

OK, I *think* I get part 2 above.  You can specify an additional filter on SPCascadeDropdowns with the CAMLQuery option.  Check the $().SPServices.SPCascadeDropdowns documentation and let me know if you have questions.

Can you tell me a little bit more on the $().SPServices.SPLookupAddNew issue so that I can try to reproduce in on my end?


Dec 10, 2009 at 1:47 PM

Hey Marc,

For the $().SPServices.SPLookupAddNew what i did is that I created a Document Content Type with Lookup columns and added it to a Document Library. First I set up the Cascading DropDowns, those worked fine. Then I tried to add the $().SPServices.SPLookupAddNew for one of the lookups. When the link "Add new" is displayed, when I click on it I get a Page Does not exist error". When I look at the URL the link redirects me to it says "http://Lists/ListName/....... As you can see the link is incorrect, It should have been http://siteUrl/lists/Listname/.....


Dec 10, 2009 at 2:04 PM

Have you tried turning on debug mode for SPLookupAddNew just to see if it is anything obvious?  Also, can you paste your call to SPLookupAddNew here?


Dec 10, 2009 at 8:48 PM

Here is my call

      lookupColumn: "Domain",
      promptText: "Add new {0} ",




Dec 10, 2009 at 8:54 PM

So your Document Library has a column named Domain, that Domain column is a Lookup column into another list, and Domain is visible on the EditForm, correct?


Dec 10, 2009 at 9:17 PM
Edited Dec 10, 2009 at 9:21 PM

I've just added in some better debug mode code for SPLookupAddNew.  It wasn't trapping in any obvious way if the column you called it with wasn't actually a lookup column.  Now with debug mode enabled, if the column isn't a lookup column, you'll get a message.  I'll post the new alpha here in a few minutes:

It will be v0.4.7ALPHA8.


Dec 11, 2009 at 1:15 PM

Hi Marc,

You exactly said what I was doing and still not working and no debug eventhough I applied the new Javascript..

Another small question for $().SPServices.SPCascadeDropdowns is it possible the parentColumn and childColumn be the internal names of the fields and not the display names? I think it would be safer that way at least we know that once created the internal name wont be changed. Because users can easily change the display name of a field.

Dec 11, 2009 at 1:21 PM

parentColumn and childColumn need to be the DisplayNames because the StaticNames aren't on the page anywhere.  We need something to look for, and the DisplayName is the Title for the control in the DOM.

So your Document Library has a column named Domain, that Domain column is a Lookup column into another list, and Domain is visible on the EditForm, correct?


Dec 11, 2009 at 1:25 PM

Yes tha tis it indeed.

The only other thing is that domain is a site column not just a column i added directly to the list don't know if that could make a difference.

Dec 11, 2009 at 1:28 PM

I don't think that the fact that it is a Site Column will make a difference as long as the Site Column is a Lookup column.  I'll try testing that, though.


Dec 11, 2009 at 1:41 PM

Tell me a little bit more about the Domain column.  You've already said it's a Site Column.  More specifics that would be helpful:

  • Domain Site Column is defined on what level?
  • What type of column is Domain looking up into?
  • The list you are working with is on what site? (Same or different than where the Site Column is defined?)
  • Are you using Content Types on the list?
  • etc.


Dec 11, 2009 at 1:49 PM


Domain is a site column defined at the Site Collection level, in the same level I have my document library

Domain is part of a Content Type I defined and added to the Document Library. And it's that content type I use to create my items in the Doc Lib

The List domain is at the Same level (Site Collection level).


On a different note is it possible in JQuery to get data from an HTML comment? Because concerning the question I asked before (using the internal name for parentColumn and childColumn) i noticed on NewForm and EditForm there is a comment at each field level with this Data:

<TD valign="top" width="400px">
  <!-- FieldName="Domain"

   <span dir="none"><select name="ctl00$m$g_62b4e022_8ac7_472a_b2af_ce1d7c46e0c2$ctl00$ctl02$ctl00$ctl01$ctl00$ctl00$ctl03$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_62b4e022_8ac7_472a_b2af_ce1d7c46e0c2_ctl00_ctl02_ctl00_ctl01_ctl00_ctl00_ctl03_ctl00_ctl00_ctl04_ctl00_Lookup" title="Domain">
     <option value="0">(None)</option>
     <option value="1">Domain 1 BA 1</option>
     <option value="2">Domain 2 BA 1</option>
     <option value="3">DOmain BA 2</option>


Dec 11, 2009 at 2:40 PM

I just tried reproducing your issue, and I can't yet.  I've got a Site Column called Domain which is a Lookup column into the Title column in a list called Domain. The call:

    lookupColumn: "Domain",
    promptText: "Add new {0} ",
    debug: true

works as expectd.  I didn't layer in the Content Type piece yet, so I wonder if that is the issue.

As far as the StaticName versus DisplayName question, I made a conscious decision to go with the DisplayName.  I wasn't comfortable with using the comment contents as my selector.  Given that there are a lot of folks out there using the library right now, it's not the time to change the logic on that, though perhaps I could expand it to accept either value.  That might introduce other issues, though.


Dec 11, 2009 at 2:50 PM

Thanks, I'll try the add new again without content types or even try to debug my problem.

As for the other point I'll try to expand it as you suggested to accept both values and I'll keep u posted. I have many power users that can change the column display names and I don't want to have to open SharePoint designer every time a column display name is changed.

Thanks a lot

Dec 11, 2009 at 3:08 PM

That's the nice thing about open source! If you come up with something that you think should be a part of the library, please kick it back over.

If you don't mind, try a little debugging, but let me know how I can help.