1

I have a parent site, created a list and added few items to it. then I have created a site column type lookup referred to that list. then created a sub site, created a new list and added the site column to it. Now, when I create an item in the sub site list, the lookup works fine as expected, but when I click on the lookup item, I get a pop up message saying something went wrong. “List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user” I have observed that in URL appending subsite name. but it should not.

Expected result should be open the parent site list item.

1 Answer 1

1

It can be done, but not using the UI.
Example copied from this answer:

#Get the webs and lists
$web1 = Get-SPWeb http://sitecollection/site1/
$web2 = Get-SPWeb http://sitecollection/site2/
$projectList = $web1.Lists.item("Projects")
$customerList = $web2.Lists.item("Customers")

#Add a lookup field
$projectList.fields.AddLookup("Customer", $customerList.id, "false")

#Get the created lookup field
$LookupField = $projectList.Fields["Customer"]

#Set the lookup web ID and lookup field
$LookupField.LookupWebId = $customerList.ParentWeb.ID
$LookupField.LookupField = $customerList.Fields["Title"].InternalName
$LookupField.Update();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.