Push Topic
Steps for demo:
- Creating a PushTopic.
- Subscribing to the PushTopic Channel
- Testing the PushTopic Channel.
Code snippets for step 1:
PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'Account';
pushTopic.Query = 'SELECT Id, Name FROM Account';
pushTopic.ApiVersion = 56.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;
Test in workbench
Create Account, Update Name on Account, Delete Account, Undelete Account via SF UI.