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
Tushar Arora 26Tushar Arora 26 

Weird behaviour seen in Debug Logs, CODE_UNIT_FINISHED is not coming in debug logs

Hi, I was reviewing one of my debug logs and I found that my debug logs are coming in the following way for one of my person account records. You can notice that CODE_UNIT_FINISHED is missing from the debug logs. Ideally, before trigger code unit must finish before running validation or before running after update trigger by using "CODE_UNIT_FINISHED" in the debug logs. Do you have any idea why "CODE_UNIT_FINISHED" is missing from the debug logs ?
 
CODE_UNIT_STARTED | AccountTrigger on PersonAccount trigger event BeforeUpdate for [0019E00000C8dR9]
.
CODE_UNIT_STARTED|[EXTERNAL]|Validation:PersonAccount:0019E00000C8dR9
.
CODE_UNIT_STARTED | AccountTrigger on PersonAccount trigger event AfterUpdate for [0019E00000C8dR9]
.
CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Account

Although, after a workflow field update gets fired, then triggers run again. This time I am able to see the  CODE_UNIT_FINISHED log as expected. 
 
CODE_UNIT_STARTED | AccountTrigger on PersonAccount trigger event BeforeUpdate for [0019E00000C8dR9] . 
CODE_UNIT_FINISHED | AccountTrigger on PersonAccount trigger event BeforeUpdate for [0019E00000C8dR9] 
CODE_UNIT_STARTED | AccountTrigger on PersonAccount trigger event AfterUpdate for [0019E00000C8dR9] . 
CODE_UNIT_FINISHED | AccountTrigger on PersonAccount trigger event AfterUpdate for [0019E00000C8dR9]

Does anyone have any idea, why it may happen ? Thanks