I have a requirement whereby leads are imported, but due to a process, they can only handle 5 leads every 10 minutes (inserting a lead triggers an inbound call to an agent).

I have come up with the following solution.

  1. New leads are imported into a temporary custom object.
  2. I write an apex class to take the top 5 records from the custom object and insert them into the leads object then delete them from the custom object.
  3. I write a scheduled task to run the apex class once every 10 minutes during office hours.

Can anyone see any flaws in my solution?

  • Wouldn't be better to create lead directly on the first step? – summer Aug 22 '19 at 10:00
  • How is the inbound call to the agent triggered? Can you not deactivate the process for import? Usually you implement logic into your processes so that you can turn them off for exactly the purpose you describe. – user40501 Aug 22 '19 at 10:00
  • @summer I don't know how often or how many leads will be imported. I want to use the custom object as a storage area so I can manage the import process – Baz Aug 22 '19 at 10:54
  • @user40501 The logic is currently disabled but they would like to enable it for imports now. – Baz Aug 22 '19 at 10:54
  • 1
    It sounds like a reasonable approach to me. – Adrian Larson Aug 22 '19 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.