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'm developing event receivers in SharePoint 2010. I have a doc. library, when someone adds to this library, a infopath form must be filled out and saved. When the form is saved to the library, my event receiver creates a Word Document based on the content of the infopath form.

In ItemAdded, I get hold of the SPFile object. I have tried to do this by using properties.ListItem.File and also by requesting it from the current web. Same behavior.

In ItemAdded(properties), the properties.ListItem.File object is not null ever.

The first time, the File object has content and a length of about 3000. The second time and from there, the File object has a length of 0 (and by that no File attached in some way).

What could be wrong?

share|improve this question
    
Ever found a solution? –  Muhimbi Mar 30 '11 at 13:00
    
Nah, afraid not. But it seems that the File has the correct behavior in ItemUpdated method, if you can use this method. –  tarjeieo Mar 31 '11 at 5:36
    
I ended up having my logic in ItemUpdated, and in ItemAdded, I just used properties.ListItem.Update() which makes ItemUpdated fire. –  tarjeieo Mar 31 '11 at 5:45
    
Can you please move your workaround to an answer as it is a valid solution to the problem? Thanks! –  Alex Angas Aug 29 '11 at 9:42
add comment

1 Answer 1

up vote 0 down vote accepted

I ended up having my logic in ItemUpdated, and in ItemAdded, I just used properties.ListItem.Update() which makes ItemUpdated fire.

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.