I have the site collection rootweb called Main Site. I have many subsites called according to the year, 2012, 2011, etc. In the rootweb, there is a list called Products. In the subsites there is a list called Sales, and I need to add a lookup field to the list Products in the root site. I found this code, but its not working, it created the lookup field, but the dropdown is empty even if there are products.

Hi alex what is the problem if i add feature at web scope?
–
Vishal_SharepointAug 27 '12 at 7:21

your field will be referenced to the list that shoud be exist in this web. If your would like to create lookup field to the list that is placed to another web, you should use webId and listId properties.
–
AlexanderAug 27 '12 at 7:56