function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Davi D11801Davi D11801 

How do I make future method call outside of a contact loop?

On the contact trigger after update and after insert,  with trigger.new, we are trying to make a future method call on contactid and associated accountid.  We got a message of too many future method call.

I talked to support and support suggested to do the future mothod call outside of the contact trigger.new loop.  But, I am not sure how to do that.  Thank you in advance for your help!
Best Answer chosen by James Loghry
James LoghryJames Loghry

It's fairly straight forward.  You wil likely need to change the signature of your future call or add another future call to accept a list of ids rather than a singular Id. Here is an example of generating a list of Strings and then passing them in to a future call: https://developer.salesforce.com/blogs/developer-relations/2013/06/passing-objects-to-future-annotated-methods.html