1

I have a use case to trigger an Email to Support Agents - Whenever record status is not moved from 'x' to 'y' within 1 hour.

whenever record status is set to 'x' - SFDC will trigger an OBM(Out Bound Message) to our middleware system to sync record data from SFDC to External System.

After successfully syncing of the data to External System it will run some business logic(Async) and will respond back to salesforce to change status to 'y' within 1 hr.

if suppose due to API call failure or due to high processing time in the backend system if the status transition does not happen within 1 hr. We have to notify the IT team.

Currently, our IT Team is periodically monitoring salesforce reports to identify the records that are stuck in 'x' status and not updated to 'y' status.

Note: the Object is having Large Data Volume of Records

I am thinking to Schedule a batch class for every 1 hr and fetch the List of Records which are stuck in 'x' status and send Email Alert to IT Team with the list of Records.

Please provide your suggestions and possible approaches to achieve above use case.

1 Answer 1

0

You have 2 options ,

  1. Scheduler Batch: The one you suggested. It will run every hour and if it finds records stuck it will make a big email and send email to IT support team

Advantage : Bulkified, Efficient

Disadvantage: Have to write code, Can't guarantee it would run at specified time. Depends on load on server. As its LDV there are chances that querry would timeout

  1. Using Timebased Workflow: enter image description here

You can send time based workflow email in same workflow that sends outbound messages. If status changes from x to y it gets removed else after 1 hour email will be sent that integration broke.

Advantage: Clicks and not code, configurable, No test classes

Disadvantages: If integration broke would send email for every record for whom outbound messaging failed. Limit on number of timebased workflow you can send hourly. https://help.salesforce.com/articleView?id=workflow_time_action_considerations.htm&type=5

You must log in to answer this question.

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