Posts

Showing posts from January, 2021

Future Callout with apex trigger for a webservice

 if(System.IsBatch() == false && System.isFuture() == false){   Error if this above condition is not used in trigger: System.AsyncException: Future method cannot be called from a future or batch method: herokuapp.animalname(String) Animal__c is a string field to update a value of o index from the webservice call. Trigger:  trigger herokuapp_account on Account (after update) {     for(account a: trigger.new)     {         if(System.IsBatch() == false && System.isFuture() == false){              if(trigger.isUpdate)             {                 herokuapp.animalname(a.id);             }         }     } } Trigger Handler  public with sharing class herokuapp {     @future(callout=true)     public static void animalname(strin...