Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to apply filtering to existing out-of-the-box lookup fields (without InfoPath).

The solution should be limited to GUI only: when Backup/Restoring to a clean farm the filtering would be gone but all the data preserved and usable.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

You might want to look at the jQuery library for SharePoint, SPServices. There is one operation, SPFilterDropdown, that allows you to filter a lookup column via CAML. Usage example from the documentation:

$().SPServices.SPFilterDropdown({
  relationshipList: "Countries",
  relationshipListColumn: "Title",
  columnName: "Country",
  CAMLQuery: "<Eq><FieldRef Name='Active' /><Value Type='Boolean'>1</Value></Eq>",
  completefunc: null,
  debug: false
});

I haven't used this particular operation, but the other aspects of the library are stellar.

share|improve this answer
    
Seems good. I will get back to this after checking the solution out. –  thomius Mar 1 '12 at 13:35
    
Tried and this works with single choice columns (not multicolumns). This is fine and problem solved. –  thomius Mar 1 '12 at 15:34
    
Just wrap the call in $(document).ready(function() { $().SPServices... –  thomius Mar 1 '12 at 15:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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