locked
Cross site lookup RRS feed

  • Question


  • I've been searching for Cross site Lookup field and came up with Sharepoint solutions cross site lookup.
    Just to find out that it's not really working as a lookup field eg.

    1. I have defined a sourcelist which has f.ex. animals (cat, dog, mouse) in another site
    2. I choose cat from cross site lookup field
    3. I edit cat item in source list to ba an elephant
    4. When I go to see my list which uses this cross site lookup chosen item still claims to be cat (and will broke down if clicked)

    So I want to do cross site lookup field which is inherited from f.ex. SPFieldLookup which stores site, listname and listitem id.
    And fetches it's valuefield everytime it willl be rendered to screen
    So is there a way to accomplish that? and if how?

    Tuesday, April 22, 2008 11:25 AM

Answers

  • I had a requirement very similar to this and below is my blog post to achieve this:

    https://blogs.pointbridge.com/Blogs/ayyapusetty_raja/Pages/Post.aspx?_ID=16

     

    One thing though, you can not add this column from UI; has to be done through code. But as your requirement states, it does update the lookup column selected values when source values are updated and it doesn't require any user control.

     

    Hope this helps.

     

    Tuesday, May 13, 2008 2:42 PM
  • This is what I did as per my requirements:

    • Created a site underneath the top level site of site collection to hold the source list.
    • Enabled anonymous access to this site.
    • Created the source list and populate it with the values. According to the example you mentioned earlier this will be the list with all the animals.
    • Now add lookup columns to a list in some site through code. This site can exist wherever in the hierarchy but should be in the same site collection. In my case we were adding these lookup columns based on some user's selection in a web part; so it was ok for us adding cross site lookup columns only through code.
    • Add the lookup columns by first constructing the field XML as I mentioned in my blog.

     

     

    Wednesday, May 14, 2008 6:22 PM

All replies


  • Found exactly what I need from:
    http://www.it-dev.pl/en/Components/SharePoint_Filtered_Lookup.aspx

    still I need to know what must be done do archieve this on code level. (and I don't mean UserControls for editing eg..)
    Which methods shoud be overridden and special properties I need.
    Anyone with more sharepoint exprience?

    Thanx.
    Wednesday, April 23, 2008 1:51 PM
  • Surely someone has done something related to lookupfield....
    My main concern is where real value is fetched from source list and how to make this kind on referencing field how it has been done originally in lookup field.
    Is it enough to overrede value getter method or is there some other approach

    Any help would be appriciated
    Tuesday, May 13, 2008 5:32 AM
  • I had a requirement very similar to this and below is my blog post to achieve this:

    https://blogs.pointbridge.com/Blogs/ayyapusetty_raja/Pages/Post.aspx?_ID=16

     

    One thing though, you can not add this column from UI; has to be done through code. But as your requirement states, it does update the lookup column selected values when source values are updated and it doesn't require any user control.

     

    Hope this helps.

     

    Tuesday, May 13, 2008 2:42 PM
  • Thanks.

     

    Seems to be what I look for at quick glance...

    Still not quite clear how to implement this approach could you provide a code sample with whole solution to put it in context?

     

     

     

     

    Wednesday, May 14, 2008 10:05 AM
  • This is what I did as per my requirements:

    • Created a site underneath the top level site of site collection to hold the source list.
    • Enabled anonymous access to this site.
    • Created the source list and populate it with the values. According to the example you mentioned earlier this will be the list with all the animals.
    • Now add lookup columns to a list in some site through code. This site can exist wherever in the hierarchy but should be in the same site collection. In my case we were adding these lookup columns based on some user's selection in a web part; so it was ok for us adding cross site lookup columns only through code.
    • Add the lookup columns by first constructing the field XML as I mentioned in my blog.

     

     

    Wednesday, May 14, 2008 6:22 PM