CustomFeedFilter defines a custom filter for Case feeds. When applied, it limits the feed view to feed items that satisfy its criteria. It controls which items appear in that view, not whether Salesforce creates the items or grants a user access to them.
A filter can select feed item types and further qualify them by item visibility or the object an item refers to. Referencing a custom object in a criterion does not turn the filter into a feed filter for that custom object; its scope remains Case feeds.
Key Elements
| Element | What the Element Controls |
|---|---|
criteria |
An array of nested FeedFilterCriterion definitions that determine which feed items appear when the filter is applied. A filter can contain multiple entries with different item types and qualifiers. |
feedItemType |
Required in each criterion. Selects the feed item type. Filter-specific choices are AttachArticleEvent, CallLogPost, CanvasPost, CaseCommentPost, ChangeStatusPost, ChatTranscriptPost, ContentPost, CreateRecordEvent, EmailMessageEvent, LinkPost, MilestoneEvent, QuestionPost, PollPost, ReplyPost, SocialPost, and TextPost. |
feedItemVisibility |
Within a criterion, selects feed items whose visibility is AllUsers or InternalUsers. It filters by existing visibility; it does not change visibility or grant access. |
relatedSObjectType |
Within a criterion, identifies the API name of the object that the feed item refers to. Typically used with CreateRecordEvent, for example to distinguish events referring to Case from events referring to a custom object. |
label |
Required. The API label of the custom feed filter. It is distinct from the component identity, fullName. |
isProtected |
An auto-generated Boolean value that currently has no impact. It is not an effective protection or access setting. |
Behavior and Constraints
Each criterion requires feedItemType. Other fields further qualify the selected items. For example, a criterion combining PollPost with InternalUsers selects internally visible poll posts. It does not make poll posts internal or give a user permission to see them.
A single filter can contain separate CreateRecordEvent criteria for Case and a custom object, alongside a criterion for internally visible poll posts. The object names identify what those events refer to; they do not expand the filter beyond Case feeds.
The broader FeedItemType enumeration can expose additional values, including ApprovalPost and TrackedChange. Their presence in that enumeration alone does not confirm support in CustomFeedFilter. The filter-specific choices are listed in the table above.
Deployment and Retrieval
CustomFeedFilter components use the .feedFilter suffix and reside in the feedFilters folder. For example, a component named myCaseFeedFilter is represented by feedFilters/myCaseFeedFilter.feedFilter.
In package.xml, use CustomFeedFilter as the type name and the component name, such as myCaseFeedFilter, as the member. The type supports the * wildcard in the manifest.
The type extends Metadata and inherits fullName as its component identity. Do not substitute the required label for that identity. FeedFilterCriterion is a nested definition inside the filter, not a separately deployable component; its entries travel with the CustomFeedFilter definition.
Relationships
A layout can reference a filter, and a filter criterion can reference an object. This creates an impact path from the consuming layout, through the filter, to the object named in a criterion. The actual connections depend on element values, not simply on these available relationships.
References
-
CustomObject:relatedSObjectTypewithincriteria. The referenced object can be standard or custom.
Referenced By
-
Layout:feedFilterName.
Name-based association: Separately from XML references, names following <objectName>.<componentName> can be associated with object metadata by taking the text before the first period in the component file base. The file base is the name after removing the directory and metadata extension; namespaces are preserved.
This association is distinct from criteria.relatedSObjectType and is not a universal naming requirement. It does not prove that the associated object exists, establish containment or automatic lifecycle behavior, require the object and filter to be deployed together, or establish deployment order. It also does not authorize deleting either component.
Common Questions
How do I retrieve a CustomFeedFilter with package.xml?
Use CustomFeedFilter as the type name and either the component name or * as the member. Retrieved components use the .feedFilter suffix in the feedFilters folder.
Can CustomFeedFilter filter a custom object's feed?
Its scope is Case feeds. A criterion can name a custom object in relatedSObjectType to select items referring to that object, typically with CreateRecordEvent, but that does not change the filter's feed scope.
Does AllUsers make feed items visible to everyone?
No. feedItemVisibility selects items by their existing visibility. Setting it to AllUsers does not change the items' visibility or grant permissions.
Does isProtected restrict access to a custom feed filter?
No. isProtected is auto-generated and currently has no impact. It is not an access restriction or an effective protection setting.