none
Site Template, local lookup column keeping reference to original RRS feed

  • Question

  • I have created a site with various lists. On the site I've used content types and site columns. One site column is local to the site and is of type lookup. i.e. looks up information in one of the lists on the site.

    The issue is I need this to be a template for creation of new sites like it. After saving out and using the template the lookup column doesn't work! It remains pulling data from the original list on the site the template was based on. Internally the WebID and ListID are set.

    Is there a way to have lookups work in site templates? i.e. lookup information from a list on the new site itself?

    I know site defs can do this but time is an issue and a site def would take much longer!

    Thanks

    • Moved by Mike Walsh FIN Monday, July 19, 2010 9:17 AM not general - moving to admin (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Monday, July 19, 2010 8:30 AM

Answers

  • Yep that's it. Just creating a field and adding to the list is updated accordingly on a new site made from the template. However using content types and site columns results in the issue I'm getting. Not ideal...!
    • Marked as answer by Tezler Friday, July 30, 2010 7:32 AM
    Thursday, July 22, 2010 8:18 AM

All replies

  • Hi,

     

    There is no good solution for this need since the list GUID will be a new value when you create a new site using this template.  You just can change the reference of the lookup field again when you create a new site with this template.

     

    Hope it is helpful!


    Seven
    Tuesday, July 20, 2010 10:16 AM
  • Thanks for your reply. This issue make's site templates pointless in my opinion ! Fixing the lookup source is not easy using the UI. You can't alter the list afterall. All you can do is recreate the field BUT then this breaks the dataview webparts on a dashboard using the field in connections. I basically end up recreating the entire site. Site def it may have to be :(
    Tuesday, July 20, 2010 11:33 AM
  • Hi,

     

    After my research and testing in my VPC, I found that the lookup field still be refer to the correct list not the original list even though the GUID of the list already changed.

    How did you found that your lookup field refers to the original list?

    Can you please check it again through clicking the lookup field with link in view properties page to see if it will be go to the correct list or original list?

     

    Hope it is helpful!


    Seven
    • Marked as answer by Seven M Friday, July 30, 2010 3:21 AM
    • Unmarked as answer by Tezler Friday, July 30, 2010 7:31 AM
    Wednesday, July 21, 2010 7:55 AM
  • Interesting!!!

    The site if for individual use. There is a list to store personal objectives. Other lists then have a field that reference this list as a lookup.

    Two reasons why I know it didn't work.

    1. Another persons site references lookup values from my source list. i.e. they seen my objectives

    2. Checked in SharePoint Manager. The ID for web and list are that of my site which was the site that was saved out as a template


    Only running SP1. Could that be it?

    Or maybe it's to do with me using a site column? Did you create the field directly on the list? (the site column is local to the new site being templated).

    Thursday, July 22, 2010 8:09 AM
  • Yep that's it. Just creating a field and adding to the list is updated accordingly on a new site made from the template. However using content types and site columns results in the issue I'm getting. Not ideal...!
    • Marked as answer by Tezler Friday, July 30, 2010 7:32 AM
    Thursday, July 22, 2010 8:18 AM
  • Changed to using normal fields and now the site template works. i.e. lookup column now looks up the correctly provisioned list.

    HOWEVER new issue:

    In the site to be templated I marked a title field as NOT REQUIRED and as HIDDEN for a particular list since it's not required. Checking the .stp all looks correct in the markup.

    <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Required="FALSE" DisplayName="Title" Hidden="TRUE"/>

    However sites created from the stp dont respect this and the title is shown and is marked as required. PROBLEM AFTER PROBLEM :(

    Thursday, July 22, 2010 12:42 PM
  • Hi,

     

    How did you change the title field as default field in SharePoint?

    The site template has lots of limitation.

    I found a useful article to introduce the site template and site definition:

    http://my.advisor.com/doc/17614?open&p=2&pid=

     

    Hope it is helpful!


    Seven
    Friday, July 23, 2010 7:44 AM
  • Used SharePoint Manager from CodePlex to change the title field. Great tool !

    As I say the stp xml file looks like it's respected that setting as the markup is correct. However creating a site seems to not respect these xml attributes and it is set back to be a required, non hidden field.

    Friday, July 23, 2010 9:19 AM