You need to sign in to do that
Don't have an account?
Error during deploying in test class that haven not been modified
I am trying to deploy some changes I have done in one trigger and in a test class (for testing that trigger), and I receivede this error during deploying.
Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, tareaToEvento_AI: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Event_AI: execution of AfterIns...
It happens in a test class which hasn't been modified.
Why is this happening?
How can I solve it?
Thanks very much
While the test class hasn't been modified, does your trigger get invoked when the test class is run, and has your trigger changed the behaviour?
If you run all tests in your dev org/sandbox, does the same error occur?
Yes, my trigger is invoked when that test class is run but not in the line the eception is thrown.
When I run all tests there is no error.
That sounds like live data is interfering with your test case then, if it only happens when deploying to production.
You'll have to fix the test though, as otherwise you won't be able to deploy your code.
But I dont understand the meaning of the error I get.
I read that error means
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
You do not have permission to create, update, or activate the specified record.
But I am System Administrator, how could be that possible?
Thanks
Is there any other information in the exception - i.e. is the DML failing due to a validation rule or similar?
I dont get more informatión from deploying error message.
Could I get more information somehow?
Thanks
I've seen other threads that suggest this may be related to the number of records in the system too.
Can you post the code that is throwing the error.
Error is thrown when new Task in inserted.
Task llamada = new Task(WhatId=c.id, Description='Adicional para: \n Cc: \n Cco: \n Archivo adjunto: \n \n Asunto: Asunto prueba \n Cuerpo: \n ', duracion__c=15, Tipo__c='Desarrollo', Subject = 'Llamada' );
insert llamada;
It, of course, cause triggers to be executed. On of them is called tareaToEvento_AI.
The name of that trigger appears on error message, but I dont know if the erros is there, since I dont get that information from deploying message.
If you run all the tests in production do you get the error?
No.
If I run all tests everything works with no error
Hmm. Sorry, can't think of much else to suggest. You might try turning on debug logging for the user that you are deploying as. That's helped me with managed packages in the past.