How I make a SPCascadeDropDown filtering 2 columns

Nov 24, 2014 at 10:38 PM
Hi Marc,
I have a list with three columns, title (which is the value that I want to get in the dropdown), facility and process.
$ (). SPServices.SPCascadeDropdowns ({
 relationshipList: "LINE-PROCESS-FACILITY"
 relationshipListParentColumn: "Facility"
 relationshipListChildColumn: "Title"
 parentColumn: "Facility"
 childColumn: "Line"
 debug: true
});
The exact value comes from filtering the line first by facility and then process, I have tried several things (CALMQuery, SPFilter and other things) but nothing works. You could help me with this please?
thank you very much
Raúl
Nov 25, 2014 at 11:56 AM
You need to separate each option parameter in the function with a comma such as...
$ (). SPServices.SPCascadeDropdowns ({
    relationshipList: "LINE-PROCESS-FACILITY",
    relationshipListParentColumn: "Facility",
    relationshipListChildColumn: "Title",
    parentColumn: "Facility",
    childColumn: "Line",
    debug: true
});
Other than that, nothing jumps out at me.

Geoff
Coordinator
Nov 25, 2014 at 2:22 PM
Edited Nov 25, 2014 at 2:22 PM
Other than the syntax issues, this should work (note you had some spaces in "$ (). SPServices" which would break it):
$().SPServices.SPCascadeDropdowns({
    relationshipList: "LINE-PROCESS-FACILITY",
    relationshipListParentColumn: "Facility",
    relationshipListChildColumn: "Title",
    parentColumn: "Facility",
    childColumn: "Line",
    debug: true
});
However, I think your question is whether you can filter line by both facility and process. You can't do this in one call. Normally, you'd have a call for Facility -> Process and then Process -> Line (assuming I understand the hierarchy correctly).

M.
Nov 25, 2014 at 5:55 PM
Edited Nov 25, 2014 at 6:01 PM
Thanks Oliver, that's right, I did not notice that when pasting the code not commas were stuck, but use the correct syntax in my code.

On the other hand thanks to you Marc and yes that's my real question. In fact I paste all the code that you see as the sequence.


$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
    relationshipList: "FA",
    relationshipListParentColumn: "Country",
    relationshipListChildColumn: "Title",
    parentColumn: "Country",
    childColumn: "Facility",
    debug: true
  });
$().SPServices.SPCascadeDropdowns({
    relationshipList: "RA",
    relationshipListParentColumn: "Facility",
    relationshipListChildColumn: "Title",
    parentColumn: "Facility",
    childColumn: "Responsability Area",
    debug: true
  });
$().SPServices.SPCascadeDropdowns({
    relationshipList: "PRO",
    relationshipListParentColumn: "Facility",
    relationshipListChildColumn: "Title",
    parentColumn: "Facility",
    childColumn: "Process",
    debug: true
  });
$().SPServices.SPCascadeDropdowns({
    relationshipList: "LINE-PROCESS-FACILITY",
    relationshipListParentColumn: "Facility",
    relationshipListChildColumn: "Title",
    parentColumn: "Facility",
    childColumn: "Line",
    debug: true
  });

});</script>
Your assessment is correct. Well, I'll see how I can fix it, because I do need to establish the relationship of three.
Thankyou very much.