Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you set the Filter for a SharePoint event receiver?

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.

like image 332
dariom Avatar asked Nov 06 '22 20:11

dariom


1 Answers

Any filtering that I have done in event receivers, I have done in code.

I found a couple of liks that seem to indicate that the filter element is either reserved, or not implemented.

http://msdn.microsoft.com/en-us/library/dd340827(PROT.13).aspx

Maybe in MOSS 2010.

like image 154
Rhys Jones Avatar answered Nov 12 '22 12:11

Rhys Jones