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
vivek12345vivek12345 

Error: Cannot_Insert_Update_Activate_Entity. Need Help

Hello All,

 

I am getting this error from last 2 days now, I have tried every thing which I got from the forms but its not resolved.

 

I have a trigger on Opportunity after insert, after update.

 

Based on amount and Opportunity Start and end date I am generating monthly cash flow, which I insert in a new custom object Opportunities_cash_flow__c, this trigger is working fine in sandbox but when I try to move it in production I get error on 4 other test classes for different triggers.

 

On though triggers I am updating a different object called Project role and Opportunities.

 

I have no Idea why I am getting this error and how to solve it.

 

Thanks

Vivek Manchanda

salesforce expertsalesforce expert

even though you did not explicitly use update statement in your trigger you might have did something like this in your trigger as given below...

 

for(Opportunity opp: trigger.new) {

opp.<some field> = value;

 

the above line is wrong as you are trying to update an record which is all the way to database for a commit! please note you even did not use explicit update statement it is still incorrect!

 

am i explained you correctly? let me know.

 

Baskaran