Help with SPCascadeDropdown function

Feb 3, 2012 at 2:34 AM

Hi there

Can anyone help me with this. I will explain what I am trying to do below.

List 1 (Parent)

List Name - ORF

Title column name - ORF Number  [Example - ORF200345]

List 2 (Child)

List  Name - ORF Items

Title column name - Item#   [Examples ORF200345#1, ORF200345#2, ORF200345#3]

Lookup column - OrfID (is a lookup to ID field in ORF)

ORF Number - Text Column and is autofilled with respective ORF Number from the ORF list using a custom NewForm. Note: Its not a lookup but still contains a matching value. I am unable to get the lookup column on custom New Form to auto-fill so, this is a workaround. So extending the above example, this would have a value of ORF200345.

List 3 (Form or this is where the code goes)

List Name - Shipments

ORF# - is a lookup column to ORF Number (Title) in the parent  [ORF200345]

ORF Item# - is a lookup column to Item# (Title) in the Child [Should be limited to ORF200345#1, ORF200345#2, ORF200345#3 only]


Now, I want to be able to select the ORF# and than filter the ORF Item# to contain the matching values only. This is not possible with the documented code because ORF Item# (child list) is not using ORF Number as a lookup column. It is using the orfID column to lookup the ID of the parent.

My thinking is that this can be achieved by doing a CAML query using the ORF# as variable but I am unable to come up with the right code. Any help would be appreciated. Another way would be some sort of javascript that simply limits the selection based on what is typed in the ORF# i.e if we type ORF200345, it should only display ORF Items beginning with ORF200345. The naming scheme and autonumbering is consistent and done by workflows.

 

Any help would be greatly appreciated. I have spent a lot of time reading the documentation, trying various codes but no luck so far.

Feb 6, 2012 at 11:33 PM

Hi

 

Please ignore my request as I managed to get it working. I ended up setting up ORF Number as a lookup column for child list and auto-filling the lookup column with javascript.This is the link which helped me to enable this -

http://blogs.msdn.com/b/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx

With that change, SPCascadeDropdowns function works like a treat.

Thanks!