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 need to create a site column that will be added to children sites, this column is a lookup referencing a list in the rootWeb, so I need to provide de WebId property in order to make it available on sub-sites.

The problem is that I don't have the root web Id during the deployment and before activating the feature. How can I solve this problem?

share|improve this question
add comment

2 Answers

If you are working on SP 2010

You simply don't need to specify a value for the webId.

As per Microsoft documentation:

The WebId attribute specifies the internal name of the site that contains the target list. If the attribute is omitted or set to an empty string, SharePoint will assume that the list is on the root site of the site collection.

So, just specify a list "url" for the List property should be enough: SharePoint will search it on the root site.

If you are stuck with SP 2007 Best approach would probably be creating the column programmatically via a feature receiver. That way you can save yourself from the GUID hell related to list and web id usage in a feature.

share|improve this answer
add comment

I'm working with SP 2010. Here is a sample of my XML schema:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field
   ID="{d4911cd3-63c8-4536-a136-1f50b4ea974c}"
   Name="MyColumnName"
   StaticName="MyColumnName"
   DisplayName="My Column"
   Type="Lookup"
   List="/Lists/MyList"
   ShowField="LinkTitleNoMenu"
   Required="FALSE"
   Group="MyColumns">
  </Field>
</Elements>

As you can see, I'm not using the WebId atribute, however the list in the sub-site that uses this site column, does not display any data.

share|improve this answer
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.