Skip to content

Instantly share code, notes, and snippets.

@SahSantoshh
Created May 23, 2020 10:28
Show Gist options
  • Save SahSantoshh/631a4b4e3b73fd4856a32496f90c65f3 to your computer and use it in GitHub Desktop.
Save SahSantoshh/631a4b4e3b73fd4856a32496f90c65f3 to your computer and use it in GitHub Desktop.
create_contact_push_topic
def create_contact_push_topic
# Create a PushTopic for subscribing to Contact changes.
contact_topic = @client.create!('PushTopic',
ApiVersion: '48.0',
Name: ENV['CONTACT_PUSH_TOPIC_NAME'],
Description: 'all contact records',
NotifyForOperations: 'All',
NotifyForFields: 'All',
Query: 'select Id, FirstName, LastName, Title, Email, Phone, MobilePhone, OtherPhone, AccountId, OwnerId, IsDeleted from Contact')
Logger.new(LOG_PATH).info('Contact Push Topic Id: ' + contact_topic)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment