0

I want to filter the lookup based on the value of the previous field.

I have two tables one contains the category and related items. the other is one the sales staff will use to make data entries.

In the field Sales/Product I want the users to pick from a filtered lookup based on the value of Sales/Category. So if a users chooses a category of Knee the Product field lookup will only display Femur Tibia.

Table Examples

I am working in WSS3 environment with the "SharePoint Filtered Lookup Field" from Codeplex.

I have seen several examples that would....
lookup product where title = "Hip"

But these are hard coded. I need an example that would be...
lookup product where title = value of field category

It seems like I should be able to do this within the query and not have to rely on any other products.

Please excuse my very crude example, it is just meant to get my point across. Any help with the proper syntax would be greatly appreciated.

Thanks!

1 Answer 1

1

You can use $().SPServices.SPCascadeDropdowns More info: http://spservices.codeplex.com/wikipage?title=%24%28%29.SPServices.SPCascadeDropdowns

var sCamlQuery = "";

// Cascade definition for State dropdown

$().SPServices.SPCascadeDropdowns({
    relationshipList: "States",
    relationshipListParentColumn: "Region",
    relationshipListChildColumn: "Title",
    relationshipListSortColumn: "Title",
    parentColumn: "Region",
    childColumn: "State" 
    completefunc: function() {
        sCamlQuery = "<Eq><FieldRef Name='Status'/><Value Type='Text'>" + $("select[title='Region'] option:selected").text() + "</Value></Eq>";
    })
});

// Cascade definition for City dropdown

$().SPServices.SPCascadeDropdowns({
    relationshipList: "Cities",
    relationshipListParentColumn: "State",
    relationshipListChildColumn: "Title",
    parentColumn: "State",
    childColumn: "City",
    CAMLQuery: sCamlQuery
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.