Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Event Receiver---ItemUpdating

$
0
0

Hi all,

I have some documents in document library with versioning ON. When i unpublish a document( in Source Library) i have to move that current version to other library(Destination Library). And i need to update a column (status) in Source as'Unpublished'. I am doing all this in ItemUpdating Event Receiver. Moving from source to dest library is working perfectly fine. But the issue is while updating that status column. Its updating that column I am getting error

The URL 'Pages/Test.aspx' is invalid.  It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.

Below is the code am using

SPListItem SourceItem = properties.List.GetItemById(item.ID);

web.AllowUnsafeUpdates = true;                                     

 this.EventFiringEnabled = false;

 SourceItem.File.CheckOut();
 SourceItem.SystemUpdate(false);
 SourceItem.File.CheckIn("Unpublished Version");
web.AllowUnsafeUpdates = false;
 this.EventFiringEnabled = true;


Please guide me. 

Thanks in advance


sam



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>