Saturday, May 5, 2012

SharePoint Column: Lookup (information already on this site)

Hi All,

This Post will discuss in detail about the options you have to set when using a Sharepoint Lookup Field. When you do a create Column in sharepoint you get it as
Lookup (information already on this site) on the Create column page.

To get a better understanding of the concept lets take up a scenario.

Scenario:

We have 2 lists
1) Company Information
2) Contacts

The relationship between then is established by using a Lookup column
“Company” in contacts

These 2 lists are placed on the Default.aspx (Home page) of the Site in the form of DataView web parts.

Refer the image as below:




What is the requirement?

Click on the “Company” Hyperlink It should take you to the DispForm.aspx of
the list item in "Company Information" List.

Click the “Close” Button of the DispForm.aspx it should bring you back to the Default.aspx (Home page) of the Site where we have the 2 DataView Lists.

Here “Company” column is a Lookup (information already on this site) Field.
To achieve the above requirement it’s very important to set its
Additional Column Settings -> In this column value to: “Title (linked to item)” and not to “Title”. Why??? Refer the reason below.


Reason:

If you set the Additional Column Settings -> In this column value to : “Title”
In a Lookup Column, then the Hyperlink column created will show a &Root Folder=* at the end of the Hyperlink URL. This will make the navigation to go to AllItems.aspx of the “Company Information” List on clicking “Close” button on the DispForm.aspx

If you set the Additional Column Settings -> In this column value to:
“Title (linked to item)”In a Lookup Column, then the Hyperlink column created will not show any such Root Folder parameter. This will make the navigation to go to Default.aspx (Home page) of the Site
on clicking “Close” button on the DispForm.aspx

Refer the Images for a clear understanding.



No comments:

Post a Comment