Represents a
subscription for a user following a record. A user can subscribe to a record so that
changes to the record are displayed in the Chatter feed on the user's home page, which is a useful way to stay
up-to-date with changes made to records in Salesforce. Feeds are available in API version
18.0 and later.
Supported Calls
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve()
Fields
| ParentId
|
- Type
- reference
- Properties
- Create, Filter, Group, Sort
- Description
- Required. ID of the record which the user is following.
|
| SubscriberId
|
- Type
- reference
- Properties
- Create, Filter, Group, Sort
- Description
- Required. ID of the User who is following the record.
|
Usage
Things to consider when following
a record:
- A user can only follow records that they can see.
- Administrators and users with the “Modify All Data” permission
can configure other users to follow records that the other user has
read access to.
- Administrators and users with the “Modify All Data” permission
can configure users to stop following records.
Note the following when using query() with subscriptions:
- Users with the “View All Data” permission can see which records
other users are following.
- Users without the “View All Data” permission need read access
on the object associated with the ParentId field to see which users are following records for the object.
- A query must include a LIMIT clause and the limit can’t exceed
1000.
- For users that don't have the “View All Data” permission, a query
using an ORDER BY clause can only
order by fields on the EntitySubscription object. For example, if the subscription relates to an Account record, the query can ORDER
BY ParentId, but it can’t ORDER BY Account.Name.
- A query using a WHERE clause
can only filter by fields on the EntitySubscription object.
- For a user that does not have the “View All Data” permission,
a query is not guaranteed to return all the matching subscriptions.
For these users, a query evaluates visibility criteria on a maximum
of 500 records to reduce the prospect of long-running queries. If
a user runs a query to see the CEO's subscriptions, a query might
scan a large number of records. The query only returns matches within
the first 500 records scanned. It is possible that there are more
subscriptions that are visible to the user, but they are not returned.
To mitigate this, we recommend using a WHERE clause, if possible, to reduce the scope of the query.
Sample—SOQL
The following SOQL query returns
subscriptions for all the accounts that you are following that have
more than 10 employees:
SELECT Id
FROM EntitySubscription
WHERE Parentid IN (
SELECT Id FROM Account
WHERE NumberOfEmployees > 10
)