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

in item updating event of list, i want to update the same item which being updating but i don't want to change and update the fields of the item but the permissions of it.
so i can't use AfterProperties property of the item because it just act for the fields.
i wrote the common code for this i mean i got the item and changed the permissions of it and then Disabled Event Firing and updated the item, but it won't update and sharepoint gives me the Conflict error(the one close your browser and blah blah stuff).
so there is any way to do this?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

For such a request i would go for ItemUpdated. Before the actual coding when registering the handler make sure you put it on Synchronous (this will prevent your actions to be spawn on 2ndary threads) - Stefan Gobner explains it pretty detailed http://blogs.technet.com/b/stefan_gossner/archive/2011/11/10/using-synchronous-quot-after-quot-events-e-g-itemupdated-in-sharepoint-2010.aspx

Also, of course make use of the Disable Event firing (be aware that methods have slightly changed in SharePoint 2010 - see here http://buyevich.blogspot.com/2010/10/disableeventfiring-is-obsolete-in.html). Also, do not forget to use AllowUnsafeUpdates=TRUE on your SPWeb.

Beyond this, see here for an example actually changing permissions in ItemUpdated http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/6d301dc7-e572-4733-9641-0d7037dcc98d/

share|improve this answer
1  
thanks for reply.indeed i considered all the tips you said already except instead of using ItemUpdating do use ItemUpdated. –  Jalali Shakib May 19 '12 at 9:38
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.