I have an after insert,after update trigger on object A which calls Database.executeBatch for insert and update operation which inserts and updates object A records.I have anotherafter insert trigger on object B which also performs DML operation for object A records.But I am getting this exception.

Database.executeBatch cannot be called from a batch start, batch execute, or future method.

Is there any work around for this so that I can bypass the trigger? Thanks for your help!


1 Answer 1


Therefore often Trigger Architecture Frameworks are used.

The fundamental principles are:

  • Order of execution
  • Separation of concerns
  • Control over reentrant code
  • Clear organization and structure

I would recommend to start reading here Generic Apex Trigger and go on with the links provided in the answer of Andrew Fawcett.

You must log in to answer this question.

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