How to query record followed and the user id using SOQL?

How to query record followed and the user id using SOQL?

If Users follow records, the entries are stored in EntitySubscription entity.

SOQL:

SELECT Id, ParentId, SubscriberId 
FROM EntitySubscription

SubscriberId – ID of the User who is following the record or user.

ParentId – ID of the record or user which the user is following.

Sample SOQL:

SELECT Id, ParentId, SubscriberId 
FROM EntitySubscription
WHERE ParentId = '5008c00001JLPRIAA5'

Leave a Reply