This project has moved and is read-only. For the latest updates, please go here.

SPCascadeDropdown question

Jul 17, 2010 at 7:20 AM
Edited Jul 17, 2010 at 7:39 AM


Im trying to use the SPCascadeDropdown function. i have two lookup fields "Practice Leaders" which will contain names of leaders. the 2nd is "Locations" which will contain locations assigned for each leader selected from the "Practice Leaders" dropdown. ive already created the relationship list for both and is working fine with the spcascadedropdown function. heres what i need to add. the requirement is when a user logs in, the "Practice Leaders" dropdown should automatically select his/her name and then cascade the assigned values to the "Locations" dropdown which should also be selected already automatically. is this possible? triggering the spCascadeDropdown based from the login id thus selecting automatically.


thanks much

Jul 17, 2010 at 1:34 PM

I'm not sure you need SPCascadeDropdowns here. The net net seems to be that you want to know the user's location. Do you have that data in the User Information List? If so, you can pull it from there.

Jul 17, 2010 at 2:34 PM

Hi Mark.

actually ive already implemented the SPCascadeDropdowns and it works fine.Please see list structure below

Practice Leaders list
Title column     userid
--------------    ----------
John Reyes      int\wsstest
Albert Studd     int\astudd


Locations list
Title                user
------               ------
Newyork           John Reyes
Los Angeles     Albert Studd

basically it works when user selects "ALbert Studd" from practice leader dropdown, it then loads Los Angeles to the Location dropdown which it should be right? what i need to do is when "int\wsstes" logs in, it automatically selects the value John Reyes from the practice leader dropdown on load so that the selected value is already set? like adding a caml query where user id = int\wsstes? hope i explained it right :)


Jul 18, 2010 at 3:07 AM
Edited Jul 18, 2010 at 3:08 AM

Would it work to use SPGetCurrentUser to grab the current user's name to populate the Practice Leader column? This would rely on the assumption that only Practice Leaders are creating items in the list, of course.  This would make your 'Practice Leaders list' uneccesary. It's a bad idea, anyway, because you're storing the Practice Leader accounts when you already know them from the User Information List.