.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Blog Site Lookup Field Changed List Reference

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :C#

We have a OOB blog site that was working fine until last week. Overnight, the Category lookup field in the Posts list began referencing the Category list from another blog on a different, unrelated sub site. I'll try to illustrate the structure below.

Top Site
	Site A
		Sub Site A-1
			Sub Site A-1-1 (Blog 1)
	Site B
		Sub Site B-1 (Blog 2)

The Posts list in Blog 1 has a lookup field for Category, which now references the Category list from Blog 2--it should reference the Category list from Blog 1.

I came up with a solution to save the site as a template, alter the reference GUID in the manifest.xml, and then re-launch the site. However, this is not a perfect solution because:

  • Upon re-launch of the blog site, all comments and posts lose the previous Created and Modified By information and instead point to my account because I loaded the site. The only way I can think to circumvent this issue would be to modify the list reference while the site is still live, but I'm not sure how to do that.
  • I still don't know how this problem happened and how to avoid it in the future.

I've been researching the problem for several days and I can't find any rhyme or reason for how it may have occurred. I was hoping the community might have some ideas for me

View Complete Post

More Related Resource Links

# string with cross site lookup field value of List in datasheet view in moss 2007

I am getting appended # code value with cross site lookup field value of List in datasheet view, and also i am getting this value while export to Spreadsheet. How to remove this value.....

# string with cross site lookup field value of List in datasheet view in moss 2007


I am getting appended # code value with cross site lookup field value of List in datasheet view. I dont want that hash coded value, i need actual value. Please provide me the solution.



Rajanikanth Rayala

Cross site lookup field value contains the parent list item id and the title field separated by ;# i

Actually we are using third party component for cross site lookup and facing the problem with cross site lookup field value. Its showing the correct value in default list view mode, but in "Edit in Datasheet" and "Export to Datasheet" view cross site lookup field value contains the parent list item id and the title field separated by ;#. I need the actual value in "Edit in Datasheet" and "Export to Datasheet" view as shown in default list value, i dont want that appended parent list item id and separated by ;#.

Is there any OutOfBox soluiton for this. Please suggest me for the same.


Issue Adding a new Lookup Field to an existing List Instance

I have a code base that houses all of the column, content types, template, and list instance definitions. Am using the Update functionlaity a lot from version to version. Has been working well to this point. I just added two new columns (fields), one a Lookup and the other a Multi-Lookup. The fields are added fine on the update, columns look correct and the content type to which these were added also look fine. I can create a new List instance from the content type, and the new lookup columns are fine. The problem is this. Any existing list instances that were created from this same content type, now blow up when I try and access list items via the SP GUI. Something about a valid GUID, I dont't have the exect error anymore, but will repost it when I recreate the issue for the tenth time. I tried deleting the new lookup fields from this new list instance, thinking that I might be able to re-add them to fix the problem, but I get a new stack trace when I try and re-add them. Any hints on where I can start digging would be appreciated. I think I'll start with comparing the list instance schemas between an existing list and a newly created one.  

Create Lookup Site Column based on External List (SharePoint 2010)


I've got an External List and I want to create a Site Column, which is Lookup to a column in my external list. If I tick any of the columns in 'Add a column to show each of these additional fields' and click OK i get the following error message:

[NullReferenceException: Object reference not set to an instance of an object.]
  Microsoft.SharePoint.SPBusinessDataField.IsInDefaultView() +58
  Microsoft.SharePoint.SPBusinessDataField.CreateSpFieldForBdcType(String bdcName, Boolean hidden, Boolean readOnly, Boolean idField, SPAddFieldOptions op) +809
  Microsoft.SharePoint.SPBusinessDataField.AddNeededSecondaryFields(String wssNames, String[] oldNames, String[] newNames, SPAddFieldOptions op) +315
  Microsoft.SharePoint.SPBusinessDataField.OnAdded(SPAddFieldOptions op) +240
  Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op, Boolean isMigration, Boolean fResetCTCol) +759
  Microsoft.SharePoint.SPFieldCollection.Add(SPField field) +61
  Microsoft.SharePoint.ApplicationPages.FieldNewPage.Save() +513
  Microsoft.SharePoint.ApplicationPages.FieldNewPage.BtnOk_Click(Object sender, EventArgs e) +46
  System.Web.UI.WebControls.Button.OnClick(EventArgs e) +114
  System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +139

Using a list from one site as the lookup (foreign key) on a list on another site


The scenario: The site "S1" in site collection "SC1" contains a list "L1". I want to use list "L" in a lookup column "L2.C" in a list "L2" in a site "S2" in another site collection "SC2." Both sites are within my company's internal network.

What's the easiest way to do this? Searches of both TechNet and the Internet failed to help.

lookup field list instance



Got and problem with and lookupfield I create some list instances, list definitions, content types with a lookupfields and all works fine  the list resovels the good list source guid so I can selected te values but when I try to save I get;

<nativehr>0x80070057</nativehr><nativestack></nativestack>Invalid data has been used to update the list item. The field you are trying to update may be read only.

When I manualy create a new list instance from the list definition everything works fine.
I'm guessing that the create list instances in the feature is causing the problem?

What am I doing wrong?


update a lookup field from different site


class FeatureReceiver:SPFeatureReceiver


public override void FeatureActivated(SPFeatureReceiverProperties properties)


SPList _SPList = (SPList)properties.Feature.Web.Lists["DestinationList"];

_SPList.ParentWeb.AllowUnsafeUpdates = true;

 using (SPSite oSiteCollection = SPContext.Current.Site) // or give a destination site collection here...
                     using (SPWeb oWebsiteRoot = oSiteCollection.OpenWeb("/sites/Source1/Source11"))
                        SPList oList = oWebsiteRoot.Lists["SourceProjectList"];

Remove List Field Type under site collection


Hi All ,

We have a custom field created and added the same under a webapplication , now I would like to remove this field type from a specific site collection , can anybody suggest as how to go about the same .





List Item View Count - Blog Site



Is there any way we can find how many times the Article is viewed in a Blog Site.

In Blog Site there is a list called Posts and I have List Items like Article1,Article2, Article3........  Is there anyway i can display the Article View count on the Post.aspx page ? i want display on each article how many times the page is viewed.

Please let me know how to acheive this ..

Thanks in Advance


WSS 3.0 Cross Site-Collection List Lookup


Hi all

New to Sharepoint here, so apologies if the question is unclear.

We would like to store centralised reference data in a dedicated site-collection and allow it to be accessed from other site-collections using list lookups. Can anyone recommend a webpart that would allow us to do this? I've found lots of cross-site list webparts, but not for crossing SC boundaries. Is there an OOTB feature that we could extend to achieve the same thing?




If you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the top-left).

If this post answers your question, click the 'Mark As Answered' link below. It helps others who experience the same issue in future to find the solution.

ListData.svc REST API can't navigate relationship to lookup list in parent site


I have created a list in the root web that contains common information used by multiple sites throughout the site collection.  I have also created a site column that is a lookup column which pulls from that list.  This way, I can add the site column to any list in any sub site in the site collection. 

I have a list in a sub site in the same site collection that I have added the root web site column to and, from the UI perspective, everything works great.  I can add a list item to the sub site list and select an item from the root web list for that column. 

However, if I generate a strongly typed data context and associated classes using a Visual Studio service reference to ListData.svc (or if I just play around with the REST XML in the browser), the class property which represents the lookup column in the sub site list only contains the ID of the lookup item, not a reference to an instance of the item. 

I understand that the experience getting list information from a different site is usually less than optimal but are there any workarounds to get a reference to that lookup list item via the REST API?

UpdateListItems to populate multivalue in the lookup field of the list



I want to populate a column which is of type lookup.I used the web service provided by the sharepoint. This column should contain multiple values. For this I used the format ID;#lookupvalue.But the column is not getting populated.

The elbatch.InnerXML looks like IS

"<Method ID=\"2\" Cmd=\"New\"><Field Name=\"RFPRequirement\" Type=\"Lookup\">623</Field><Field Name=\"Product\" Type=\"Lookup\">232</Field><Field Name=\"Offering\" Type=\"Lookup\">49</Field><Field Name=\"Services\" Type=\"Lookup\">212;#B: Event Management Service;#215;#(B) Incident Management Service;#217;#(B) Proactive Problem Management Service</Field></Method>"

Also I tried separating only the IDs by ;#.The elbatch.innerxml is

"<Method ID=\"2\" Cmd=\&q

cross-site list lookup using sharepoint 2010


Hi All,

Just want to ask how can I cross-site list lookup using sharepoint 2010.

 I’ve created two Sites. TestSite1 that has a list called List1 and TestSite2 that has a list called List2. The problem is when I tried to create a lookup column in List2 so I could see the List column in TestSite1 I could not find it.

How can I do this using the OOTB SharePoint 2010?


Thank you in advance.

Workflow - Create New List Item with lookup field


I have an 'Item list' that has 'ItemName' as a string. The Workflow creates a new 'Task' when a new Item is created. The 'Task' has 'Item Name' as a lookup to that 'Item list'.

I want the Workflow to "Create New List Item" and fill in the 'ItemName' lookup (in Task) with the 'ItemName' string (in Item).

The workflow won't do it because they are different 'types'. Is there a way around this?   

Submitting data to a lookup field in a SharePoint list


I'm trying to submit values to a SharePoint list that contains text fields and lookup fields.  I'm doing this with a WebServiceConnection and an XML file.  When I execute the submit without the lookup field, it works perfectly.  When I execute the submit with the lookup field it doesn't error out but my list is not updated.  Can anyone help?

Toolbox: Serializing objects, Scott Allen's blog, Site Performance, and more


Serialize and Deserialize Fixed Length and Delimited Files, Scott Allen's blog, inspecting Web Pages, and more.

Scott Mitchell

MSDN Magazine August 2008

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend