locked
Filtered Lookup Field dinamically RRS feed

  • Question

  • Hello, I have a question about the component named 'Filtered Lookup Field':

    I have two lists.

    One list called 'Elementos' with a text field named LinkTitle

    Other list (Inventario) with a lookup field named Elemento.

    Elemento List has a field of the type Filtered Lookup which has the next calm query:

    <Where><Eq><FieldRef Name="LinkTitle"></FieldRef><Value Type="Text">{$Elemento}</Value></Eq></Where>

    but it doesn't work. I don't manage to return the value of the element edited.

     

    Could somebody help me?

    Thanks in advance.

    Tuesday, January 31, 2012 4:26 PM

Answers

All replies

  • In order to query a lookup field try something like below

    SPQuery query = new SPQuery();
    query.Query = 
    "<Where><Eq><FieldRef Name='FieldName'/><Value Type='Lookup'>" + fieldValue+ "</Value></Eq></Where>"
    


    Hope it gives you some idea 

    Tuesday, January 31, 2012 7:34 PM
  • The problem is I'm trying to do this without programming only in design time and I don't know If there is any way to take the value of the field which I'm editing in the list.

    I'm using the component of codeplex called Filtered Lookup Field which is of open source but the camel query is wrong.


    Tuesday, January 31, 2012 8:51 PM
  • You can also try to use InfoPath forms to create filtered lookup fields.

    https://www.nothingbutsharepoint.com/sites/eusp/Pages/creating-filtered-lookups-in-sharepoint-2010-with-infopath-2010.aspx

    But be sure before trying infopath forms I dont think you can get your original list forms back once created customized infopath forms for lists.

    • Marked as answer by Pengyu Zhao Tuesday, February 7, 2012 1:51 AM
    Friday, February 3, 2012 7:47 PM
  • Thanks, I think that I'll try it with InfoPath.
    Friday, February 3, 2012 9:54 PM