SPCascadeDropdowns not woking in SharePoint 2013 Office 365

Sep 20, 2013 at 4:02 PM
Edited Sep 20, 2013 at 4:55 PM
Using:
  • Office 365 version 2013 dutch empty site template
  • jquery 1.8.3
  • spservices 2013-2
have 3 lists:
  • a list named "Cliënten" (list with form attached)
  • a list named "ZZP grondslagen" (lookuplist for column in relationship list)
  • a list named "ZZP indicaties" (relationship list)
"Cliënten" list contains a lookup column named: "Dominante grondslag" (displayname) -> Points to list "ZZP grondslagen" with internal column named "Afkorting"(single line of text).
"Cliënten" list contains another lookup column named: "Zorgzwaarte" (displayname) -> Points to Relationshiplist "ZZP indicaties" with internal columnname "Indicatienummer" (number).
"ZZP indicaties" list contains named "Grondslag" (internal name) -> Points to "afkorting(internal name)" in "ZZP grondslagen" list.

Looks like this:
<script language="javascript" src="/sites/careportal/Script/jquery.min.js" type="text/javascript"></script>
<script language="javascript" src="/sites/careportal/Script/jquery.SPServices.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

 $().SPServices.SPCascadeDropdowns({
  relationshipList: "{96E65BA3-A89C-44B3-AD61-066A978B6A6F}",
  relationshipListParentColumn: "Afkorting",
  relationshipListChildColumn: "Indicatienummer",
  parentColumn: "Dominante grondslag",
  childColumn: "Zorgzwaarte",
  debug: true
});

</script>
Problem: Parentcolumn Dominante grondslag
Message: column not found

I'm certain internal names and display names are correct..
Hope someone can help out

Edit: Slimmed down code
Note:
  • For testing purposes: all lookups are changed to single value, no change
  • Columns are all part of 2 content types (all columns based on site columns)
  • Also tested with local columns, same result
  • Spaces in display names cannot be the problem i think
Coordinator
Sep 20, 2013 at 4:34 PM
maunx:

I'm certain that I've never tested on a Dutch site. The issue with other languages is that the translations in the element attributes are all over the map. I've got logic for German and Russian already because people have pointed out issues in the past, but never Dutch.

All that said, it may not be the language that's the issue. Try slimming down your code to this. You shouldn't pass options that you don't need.
 $().SPServices.SPCascadeDropdowns({
  relationshipList: "{96E65BA3-A89C-44B3-AD61-066A978B6A6F}",
  relationshipListParentColumn: "Afkorting",
  relationshipListChildColumn: "Indicatienummer",
  parentColumn: "Dominante grondslag",
  childColumn: "Zorgzwaarte",
  debug: true
});
The code above will look for the list with GUID {96E65BA3-A89C-44B3-AD61-066A978B6A6F} in the current Web. Note that you can also use the list's name, like "My List".

Are any of your dropdown columns multi-select?

M.
Sep 20, 2013 at 5:00 PM
Hello Marc,

The column "Grondslag" in the list "ZZP indicaties" list was a multi but I changed it to single value with the same result..
I also slimmed down the code. List name or GUID makes no difference(tried just to be sure). Content is all on same site.
Coordinator
Sep 20, 2013 at 5:38 PM
The error you're getting from my debug code is:

Problem: Parentcolumn Dominante grondslag
Message: column not found

Both the parentColumn and the childColumn should be the DisplayNames. Since you have a space in "Dominante grondsl", I assume that's the DisplayName?

Here's the function that's looking for the column:
    function DropdownCtl(colName) {
        // Simple
        if((this.Obj = $("select[Title='" + colName + "']")).length === 1) {
            this.Type = "S";
        // Compound
        } else if((this.Obj = $("input[Title='" + colName + "']")).length === 1) {
            this.Type = "C";
        // Multi-select: This will find the multi-select column control in English and most other languages sites where the Title looks like 'Column Name possible values'
        } else if((this.Obj = $("select[ID$='SelectCandidate'][Title^='" + colName + " ']")).length === 1) {
            this.Type = "M";
        // Multi-select: This will find the multi-select column control on a Russian site (and perhaps others) where the Title looks like 'Выбранных значений: Column Name'
        } else if((this.Obj = $("select[ID$='SelectCandidate'][Title$=': " + colName + "']")).length === 1) {
            this.Type = "M";
        // Multi-select: This will find the multi-select column control on a German site (and perhaps others) where the Title looks like 'Mögliche Werte für &quot;Column name&quot;.'
        } else if((this.Obj = $("select[ID$='SelectCandidate'][Title$='\"" + colName + "\".']")).length === 1) {
            this.Type = "M";
        // Multi-select: This will find the multi-select column control on a Italian site (and perhaps others) where the Title looks like "Valori possibili Column name"
        } else if((this.Obj = $("select[ID$='SelectCandidate'][Title$=' " + colName + "']")).length === 1) {
            this.Type = "M";
        } else {
            this.Type = null;
        }
    } // End of function DropdownCtl
If "Dominante grondslag" isn't multi-select, the code is looking first for a select element with the Title="Dominante grondslag" and if that is not there, then an input element with the Title="Dominante grondslag". Can you look at the DOM to see if one of those is present?

M.
Sep 21, 2013 at 10:26 AM
Hmm.

Codeview gives me this:
<tr>
<td nowrap="true" valign="top" width="113px" class="ms-formlabel">
  <h3 class="ms-standardheader"><nobr>Dominante grondslag</nobr></h3>
</td>
<td valign="top" width="350px" class="ms-formbody">
<!-- 
FieldName="Dominante grondslag"
FieldInternalName="Dominante_x0020_grondslag"
FieldType="SPFieldLookup"
-->
<span id='WPQ2deb98cf7-0975-4514-b45c-f923526a4d99Dominante_x0020_grondslag' data-sp-control='SPFieldLookup' data-sp-options='{&quot;mode&quot;:3,&quot;source&quot;:&quot;Dominante_x0020_grondslag&quot;}'></span>
</td>
</tr>
and the developer toolbar gives me
<select title="Dominante grondslag" id="Dominante_x0020_grondslag_34e0de5b-dcdf-4662-821c-4fedbacda0bb_$LookupField">
for the dropdown, so it should find it correct?
Sep 21, 2013 at 10:42 AM
I also tested the simplest form with the lists TESTCity, TESTCountry and TESTForm.
Same error. I'm sure i'm doing it right since i'm using it all the time, just not on 365..
Sep 23, 2013 at 9:45 AM
Well...I got it working.

It ended up being very trivial.
Somehow I suddenly stopped getting a debug window like mentioned by others (after switching to different browser modes) so I decided to look into it a bit more.
Script calling seemed unreliable so just put it into $(document).ready(function() {} and my issues disappeared..

Thanks for the answers Marc!
Back to testing now.. :-)
Coordinator
Sep 24, 2013 at 5:12 PM
Great!

M.
Dec 3, 2014 at 10:40 AM
I have same problem with Choice field. Code was working absolutely fine in Office 365(SharePoint 2010), when site is migrated to SharePoint 2013, it stopped working. For choice field I am not able to locate <select> attribute in the view source.

Any updates on this issue will be very useful to me.
Coordinator
Dec 3, 2014 at 1:18 PM
It ought to work. I you read through the above, it wasn't an SPServices issue.

If you are still having problems, please start a new thread with details and I'll try to help out.

M.