Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a List Item and I wanted to delete it. It's nothing special at all, but it fails.

I have two lists, Company and Company Contacts. Each Company have 0...n contacts. A company can't be deleted as long it has 1 or more contacts. So thats why I have set the RelationshipDeleteBehavior to "Restricted".

Here the field definition:

  <Field
   Description=""
   DisplayName="Lieferant"
   Group="Phonebook"
   ID="{8c6fe81d-0ac2-45cc-b14f-592855c16c77}"
   Name="Supplier"
   List="Lists/Suppliers"
   Indexed="TRUE"
   ReadOnly="FALSE"
   Required="TRUE"
   StaticName="Supplier"
   EnforceUniqueValues="FALSE"
   UnlimitedLengthInDocumentLibrary="FALSE"
   ShowField="Title"
   ShowInDisplayForm="TRUE"
   ShowInEditForm="TRUE"
   ShowInNewForm="TRUE"
   RelationshipDeleteBehavior="Restrict"
   Type="Lookup" />

If I want to delete a company it fails all the time. It doesn't depend on if it has contacts or not. The Log tells me that I following failure:

LockManager: A Web Lock should have been taken here

How could I resolve this failure? I am using SharePoint 2010 SP1.

share|improve this question
add comment

1 Answer

I know the thread is old, but someone might stumble upon it.

I have the same problem and found a possible solution for it here. But I havent tried it yet. Though I do know that the problem goes away if you recreate the column in the UI, or simply create it without setting the Intexed="True" and RelationshipDeleteBehavior="Restrict" values in the definition, and then set them manually in the UI.

However, for me, that is not an option since the lists have to be created over and over again, therefore I will try the solution suggested in the link. Apparently, the problem is a bug preventing the forementioned properties to be set in the definition. Instead, you have to activate them later on, perhaps in a separate feature or something.

Hope it helps someone at least. But as I said, I haven't tried it yet.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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