Last active
August 21, 2018 09:43
-
-
Save choudharymanish8585/6b3cab4f0e117a1de62c07a232c02fd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Run this code in anonymous window of developer console | |
//Here my channel name is "AccountSpy" which will be used for subscription | |
PushTopic pushTopic = new PushTopic(); | |
pushTopic.Name = 'AccountSpy'; | |
pushTopic.Query = 'SELECT Id, Name, Type, Phone, Website FROM Account'; | |
pushTopic.ApiVersion = 43.0; | |
pushTopic.NotifyForOperationCreate = true; | |
pushTopic.NotifyForOperationUpdate = true; | |
pushTopic.NotifyForOperationUndelete = true; | |
pushTopic.NotifyForOperationDelete = true; | |
pushTopic.NotifyForFields = 'Referenced'; | |
insert pushTopic; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment