Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Problem With Event Sink

  Asked By: Brent Diaz         Date: Apr 28, 2004      Category: Sharepoint      Views: 170

In one of our projects, we are trying to register an Event Sink for a
Document Library. In the event sink we need to update few Taxonomy
Fields of the uploaded file. We are able to succeed in this regard. But
when we fire a search with the Metadata we fail to view the file in the
restltset.

However by removing the update taxonomy fields functionality (shown bold
in the code snippet - this uploads Metadata to the File) in the Event
sink or removing the Event Sink from the document library we are able to
successfully search for the document.

How to overcome this problem? The code snippet of the EventSink is given
below:

Code Snippet:
-----------------
public void OnEvent(Microsoft.SharePoint.SPListEvent evt)
{
if(evt.Type == SPListEventType.Insert)
{
SPWeb mySite = evt.Site.OpenWeb();
file = mySite.GetFile(evt.UrlAfter);
try
{

file.Item["Last Modified By"] = evt.UserLoginName;
file.Item.Update();
}
catch(Exception e)
{
LogInfo("My Update " + e.Message);
}
}
}


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:        

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Problem With Event Sink Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].