VseWSS Create list with lookup field RRS feed

  • Question

  • I have created two lists.
    How to create a lookup field in the second list, linked to field from first list?

    Thursday, September 24, 2009 11:35 AM


  • Well, the "easiest" way to do this is through the user interface. If you want it to be auto performed each time the lists are created then you have to do it programmatically.

    The reason for this is because Lookup Fields require the GUID of the list that they lookup to. This cannot be pre-determined (because it is dynamically generated by SharePoint each time a new list is created) which makes it impossible to achieve through CAML.

    The best bet is a feature receiver or custom logic of some kind which uses the API to programmatically add the lookup field and configure it.
    Martin Hatch
    MCPD .Net Web Development
    MCTS WSS 3.0 | MOSS 2007
    Visit my Blog
    Thursday, September 24, 2009 11:44 AM