Google-sovellukset
Päävalikko

Post a Comment On: mo.notono.us

"Getting the ContentType from an ItemAdding Event Handler"

6 Comments -

1 – 6 of 6
Blogger Clem said...

properties.AfterProperties["ContentType"].ToString is null in afterproperties. This does not work!

Friday, October 12, 2012 9:39:00 AM

Blogger Oskar Austegard said...

Clem, sorry it's not working for you. It did for me 3 years ago, can't say I have tried since.

Friday, October 12, 2012 10:10:00 AM

Anonymous Anonymous said...

Document Library and Picture Library have different rules...

Library BeforeProperties AfterProperties properties.ListItem
ItemAdding No value No value Null
ItemAdded No value No value New value
ItemUpdating Original value Changed value Original value
ItemUpdated Original value Changed value Changed value
ItemDeleting No value No value Original value
ItemDeleted No value No value Null

Wednesday, October 31, 2012 6:32:00 PM

Blogger Oliman said...

This article is outdated. Whoever wrote it, must delete it before it wastes anymore time of others

Tuesday, April 08, 2014 1:25:00 AM

Blogger Oskar Austegard said...

Thanks Oliman for such an insightful comment. Your valuable time must most certainly not be wasted. Perhaps if you slow down a bit you would notice things like dates showing the post is 5 years old. But it's great to learn that Microsoft has moved on since then.

Tuesday, April 08, 2014 7:32:00 PM

Blogger Scheevel said...

Here are some results captured from the immediate window while debugging...

? properties.ListItem.ContentType
'properties.ListItem' is null

? properties.AfterProperties["ContentTypeId"]
"0x0120D520003BBF99EB54C34597ACF700732E3882F600AA09EB683FFEB74BA408BE00002EB8DE"

? properties.AfterProperties["HTML_x0020_File_x0020_Type"]
"SharePoint.DocumentSet"

-override ItemAdding
-SP 2010
- Custom Content Type Event Receiver in a Document Library (with the Document Set feature activated)
Hope this helps.

Friday, May 30, 2014 3:10:00 PM

You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot