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
paddingtonpaddington 

Insert fires AfterUpdate trigger

I'm slightly confused....I'm going through the debug log for a test and when I insert an account, a trigger fires which is AfterUpdate only:

 

20091113150327.165:Class.TEST_Assessments.TESTcreateIEFfromAccount: line 9, column 9: SINGLE CASE - creating test account
20091113150327.165:Class.TEST_Assessments.TESTcreateIEFfromAccount: line 11, column 9: Insert: SOBJECT:Account
*** Beginning IEFsubStage on Account trigger event AfterUpdate for 001T000000EbVdA

 

Does this mean that AfterUpdate triggers fire on inserts as well? I've scoured the documentation and can't find any references to this anywhere, with the opposite being explicitly specified:

 

"The update DML operation modifies one or more existing sObject records, such as individual accounts or contacts, in your organization’s data. "

 

 If the account doesn't exist until I insert it, then how does SFDC interpret this as an update?

 

Best Answer chosen by Admin (Salesforce Developers) 
Cool_DevloperCool_Devloper

Hi Pads,

 

Ideally, AfterUpdate Trigger should not be fired on Insert of any object.

 

Maybe in your case, there is workflow which is updating a field on Account which is then triggering the trigger. Can you check if there is any kind of DML happening on the record after it is inserted?

 

Only that can cause this issue!

 

Cool_D

All Answers

Cool_DevloperCool_Devloper

Hi Pads,

 

Ideally, AfterUpdate Trigger should not be fired on Insert of any object.

 

Maybe in your case, there is workflow which is updating a field on Account which is then triggering the trigger. Can you check if there is any kind of DML happening on the record after it is inserted?

 

Only that can cause this issue!

 

Cool_D

This was selected as the best answer
paddingtonpaddington
You're right Cool_D, thanks. Workflow was updating the inserted account.