Hi The Happy Giraff..
For filtering attributes, here are the links you can see:
aileengusni.blogspot.com/.../crm-2011-2013-mastering-plugin.html
crmbusiness.wordpress.com/.../crm-2013-step-by-step-update-plugin-tutorial-using-the-crm-2013-development-toolkit
mscrmshop.blogspot.com/.../use-of-filtering-attributes-during.html
andz88.wordpress.com/.../set-filter-attributes-update-plugin-dynamics-crm-2013-upgrade-gotcha
And for the images here:
inogic.com/.../pre-image-post-image-explained
crmbook.powerobjects.com/.../plug-in-images-pre-vs-post
Here is also overview tip for plugin written very well here:
www.slideshare.net/.../melbourne-crmug-oct-2014-just1-tip-slides
Basically the concept of Filtering Attributes is you want the plugin only be executed if only set of fields (attributes) are changed, otherwise the plugin wont be executed, this is the simple words and concept of it without seeing the links.
So, let's say you have a plugin on update account that has long running time.
But, in fact it's only affected if an address field is changed, otherwise you no need this logic.
So, you can filter the attribute on this plugin.
For the Pre-Image..
Basic concept here is let's say you have account entity plugin.
Then, your original value is like this:
Name = The Happy Giraff Corp
Website = www.thehappygiraff.com
Employee size = 100
Level = Platinum
Now, you change the employee size to 50
Here, in your plugin, you want to check the Level.
So means that if Level = Platinum, the Account employee size cannot be less than 100, it must be something wrong with the new input, you need the validation.
So that in the plugin, as we know, we have input parameter as current target entity context.
You want to check if Level == Platinum, then check current employee size.
So in this context, currently:
you cannot use entity["new_level"] and it will return null, because what? Because you didn't change any Level, right? The only value you changed is only Employee Size, which is 100 to 50, for the Level, it is still Platinum.
What you need to do is you should use preImage to get the ORIGINAL VALUE of the LEVEL field.
So that, you need preimage, then you can have this code:
preImageEntity["new_level"]
So that you can use PostImage or PreImage as well for the Level since they are same value.
As addition in my explanation, I explain as well the PostImage for better understanding.
For the employee size you will have different value:
current entity = 50
preimage = 100
postimage = 50
What about Level?
current entity = NULL
preimage = Platinum
and postimage = Platinum.
I hope this can help you.
Thank you.