1

We have some of our objects and fields synced to other systems and one of the common concern we see is the changes to these objects / fields (specifically deleting them in salesforce) are impacting the sync and the target systems.

So my question is how to raise an alert (say an email or an api call or any other action) when there's a change to these objects / fields

I have already checked this question Identify salesforce schema changes

I believe using Metadata api to look for the changes and doing custom implementation is one option. but its more like monitoring / polling for changes and pulling the information.

I am looking for an option (any out of the box , app exchange, custom triggers, etc.. ) within salesforce that can identify the change and raise an alert or push it out..

Thanks

3 Answers 3

0

I don't think there is anything out of the box. If you are using GitHub/Jenkins. You could make notification every time someone make a push on your repo or break the build. Don't allow people to make manual config changes in production. If you are the product owner of your external systems, I would do the same on each system that are connected together.

I would also avoid to use the standard salesforce API, which doesn't provide any log system. So if you have a problem in your integration, you will probably need a few days before to realise their is a problem. Better to create your own webservice and implement a APILog process that records every transaction. At least you can notify an administrator and action quickly.

PS: sorry I wanted to put that in a comment but too long

0

There may be a better idea but here's something workable

  • Identify all the object/fields that are used across all the interfaces. Save their names in a custom object (one fieldname per record - or maybe as a json array saved in a long text field)
  • Write a scheduled apex job that runs every day. The scheduled job constructs a dynamic SOQl query using the fields fetched from the custom object
  • The scheduled job wraps the SOQL in a try/catch. If the field no longer exists, an exception will be thrown
  • In the catch block, send an email to the relevant admins

You can make this more sophisticated by defining which fields apply to which interface so your alerts can be more meaningful.

1
0

Streaming API seems to match your needs well. From their docs:

Streaming API enables streaming of events using push technology and provides a subscription mechanism for receiving events in near real time.

Full link: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm

I don’t think you can use it to subscribe to metadata changes, but you could use the Change Data Capture Event to listen for all data changes on an object and check if there are any new fields in the data.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .