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
Andrew LikensAndrew Likens 

Creating/updating an opportunity calls @future method on the account. Why?

I have a method that is setup to make an @future call on the account and contact. However, I have a third-party tool that makes updates to the opportunity. Whenever this third-party tool makes an update or a user creates an opportunity, it calls my @future account method setup. Why would that be? Our goal is not to call my method at all when creating/updating an opportunity because now we're running into the "too many future calls:51" error because the third-party tool does batch updates to the opportunity. I know there's a lookup relationship with account and opportunity, but that can't be the case here. Any insight would be greatly appreciated!
Best Answer chosen by Andrew Likens
snehal surti 3snehal surti 3
Have you checked if there is any trigger invoking the future method for making some updates to account and contact.You should check your triggers on opportunity and see if there any reference to this method.

All Answers

snehal surti 3snehal surti 3
Have you checked if there is any trigger invoking the future method for making some updates to account and contact.You should check your triggers on opportunity and see if there any reference to this method.
This was selected as the best answer
Andrew LikensAndrew Likens
Hi thanks for the quick reply. There is a trigger each on the account and contact, but they don't reference the opportunity at all. There are no triggers made on the opportunity.
snehal surti 3snehal surti 3
Have you checked if any process builder making any apex calls?

Can you also find all references to the method from every apex class and trigger? It might be update on one object creating update on another object and which is resulting into future method call.
Andrew LikensAndrew Likens
I did find another trigger by another application on the opportunity that could potentially be calling my @future method. I reached out to the application company to inquire about their trigger. Thanks for the help!