SPItemEventArgs::BeforeProperties and AfterProperties

Some useful posts (and its comments also!):

Summary:

  • ChangedProperties always contains nothing
  • Other members no always contain meaningful values – depends on event
  • AfterProperties.Count will always be 0 but AfterProperties[COLUMN_NAME] will have values.
  • The values stored in the AfterPropereties collection are all stored as strings

Excerpts:

I managed to also get information about the item in the ItemAdding event by using…
properties.AfterProperties[“InternalColumnName”].ToString()
Note that the if the column display name has spaces in it (e.g. “Internal Column Name”) then the internal column name will most likely be something like “Internal_x0020_Column_x0020_Name”. User can change this collection item to change the value to be saved to database.
In the ItemUpdating event
properties.AfterProperties[“Description”] will give the new value
and customer[“Description”] will give the existing database value.
In ItemUpdated you can not get this as the valued have been commited.

Advertisements
This entry was posted in Events and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s