I've only recently noticed the Filter
element in the definition file for a SharePoint event receiver:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers>
<Receiver>
...
<Filter />
</Receiver>
</Receivers>
</Elements>
The MSDN documentation for the SPEventReceiverDefinition.Filter property says that the value: "represents the filter for the SPListItem object". And includes the following remarks:
"Event handlers are registered at the site or site collection level to implement filtering to respond to list item events. Filtering allows multiple rules to be applied in sequence to limit the size of a list or some other dimension of that list. They are specified in persistent storage as name-value pairs in the form of assignment statements."
My question is: how can I set the value of the Filter? Would you use a CAML <Where>
element?
I'm just curious at this stage. I don't have a reason to use this, but saw it and starting wondering. I searched through all event receiver definitions in SharePoint 12 'hive' folders and none had a filter applied.