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
Sohel Shaikh 23Sohel Shaikh 23 

Not able to update Account object in Batch class called by Account trigger

Scenario :
I have an Account object and Schedule__c object.
I want to update account and Schedule__c objects' fields on update before trigger.
When I update Account in Batch class called by Account trigger I am getting following exception:
Update failed. CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
When I remove update accoount; statement from the execute() function of batch class it is not reflecting the changes made in account object as it does automatically in Account trigger.

PLease let me know if anyone has the solution.

Thanks,
Sohel
Lucian Mihai CiobanuLucian Mihai Ciobanu
I need more details on this. The error is too vague. We need the full error and the key pieces of code. Otherwise, it's a guess.
Amit Chaudhary 8Amit Chaudhary 8
Please share the code with us so that we can help you better