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
shailesh_rawteshailesh_rawte 

Future Working in Batch Apex But dont know how

Hello All,

As you know that future not working in Batch or its not be chained.
But in my scenario i can able to call future method from Batch Class.

Regards,
Shailesh Rawte
AnudeepAnudeep (Salesforce Developers) 
While @Future cannot be called from a batch class, a webservice can. A webservice can also call an @future method. Can you post your code here? 

Also, look at this discussion
shailesh_rawteshailesh_rawte
Here my code is
----------------------------------------------------------------------------
global class GS_UpdateAssetQuantityBatach_AC implements Database.Batchable<sObject>{
    global static String queriyLimit;
    global Database.QueryLocator start(Database.BatchableContext BC) {
        return Database.getQueryLocator(query);
    }
     
    global void execute(Database.BatchableContext BC, List<Product_List_Detail__c> productListDetails) {
      GS_Rest_AccoutCUDashORG.createAccount(listofSte)
    }   
     
    global void finish(Database.BatchableContext BC) {
        // execute any post-processing operations like sending email
    }
}
---------future---------
Global class GS_Rest_AccoutCUDashORG{
@future(callout=true)
 public static void createAccount(Set<id> productListDetailsID)
    {
        }
}
shailesh_rawteshailesh_rawte

and the same code  i have exucuted in developer edition org it's throghing an error. but in my orgination sandbox working fine.
AnudeepAnudeep (Salesforce Developers) 
Can you please tell me on which instance your developer edition org is on and on which instance your sandbox is on?
shailesh_rawteshailesh_rawte
Sandbox : CS50
Developer org:AP5