I was attempting to call a future callout method from a trigger and am getting the error that a future method can not be called from a future or batch method. The trigger is being called on insert of a ContentDocumentLink object, which is inserted by a managed package in our org (so I can't see what it's doing). I am only calling one future method and no batch methods. Am I ok to assume the managed package is using a future method to insert the document link? Or, even if it is, would it not cause this issue?

If it is an issue, any suggestions on the best way to go about writing a trigger that implements a callout knowing a batch/future method will start the trigger?

1 Answer 1


If your code is already asynchronous, you don't need to use a @future method to call out. So you can add checks for this sort of thing.

public static void makeCallout(/*params*/)
    if (!system.isFuture() && !system.isQueueable() && !system.isBatch()
static void makeCalloutAsync(/*params*/)

You must log in to answer this question.

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