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
raj kiranraj kiran 

future call inside schedule batch apex

Hi All,

I am working on case where a scheduled batch calling a future method/class. As salesforce restricts the future call from batch , i am looking for any other alternative or workaround for this .

I need to use the future call  in schedule batch because , the dml operation i do in future call is on configuration object, performing dml operation on configuration objects causes us Mixed DML exception . To over come this error we need to use the future call.

Any light on this is of great help.
AshwaniAshwani
Instead of calling future method:

Create an object where you can seve detail which need to be updated in setup object
After that when oyu batch finish, in finish() method schedule a new class or fire another batch on that object which store setup object details in perform updates.
raj kiranraj kiran
Ashwani,

Thanks for the idea. will check out the approach.