web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

LookUp for Site Definition in SharePoint.

Nishant Rana Profile Picture Nishant Rana 11,325 Microsoft Employee

Suppose we have created a site definition for an existing Site having two lists and one of the lists uses a lookup column that points to the other list.

Now if we are creating site using that site definition we will find our lookup column missing in the list.

If we check the schema.xml for our list, we will find our lookup field to be commented.

LookUp

To get it working ,  we need to define the field in the following manner

Original

<Field Type="Lookup" DisplayName="myLookUp" Required="FALSE" List="{72424dd2-9030-408a-97c9-8482d9d81204}" ShowField="Title" UnlimitedLengthInDocumentLibrary="FALSE" ID="{f50277a0-4da5-46d3-8e60-284c729a3eb8}" SourceID="{07e7832d-45df-4f69-b5bb-e31c5107c5ca}" StaticName="myLookUp" Name="myLookUp" ColName="int1" RowOrdinal="0" />

It should be modified to

<Field Type="Lookup"
DisplayName="myLookUp"
Required="FALSE"
 List="Lists/SecondList"
ShowField="Title"
ID="{f50277a0-4da5-46d3-8e60-284c729a3eb8}"
StaticName="myLookUp" Name="myLookUp" ></Field>

SecondList :- The name of the other list.

Check this wonderful post

http://www.mtelligent.com/journal/2007/10/14/adding-back-lookup-columns-in-the-provisioning-handler.html

 

Bye…


Filed under: MOSS, SharePoint Tagged: SharePoint

This was originally posted here.

Comments

*This post is locked for comments