2

I'm trying to troubleshoot a trigger on the Account object but the debug logs are not showing any entries. Here's what I've done:

  1. Created a new trigger named "BeforeInsertTrigger" on the Account object with a before insert context.
  2. Inside the trigger, I added a simple debug statement: System.debug('BeforeInsertTrigger Hello World!'); enter image description here
  3. Enabled debug logs for the current user with the appropriate trace flag and debug detail enter image description here enter image description here 4.Created a new Account record.

5.Checked the debug logs, but there are no entries. enter image description here

Expected Behavior: The debug statement should be logged when a new Account is created.

Actual Behavior: The debug logs are empty.

Question: Can anyone advise why the debug logs are not showing the trigger execution, even though the trigger is defined and trace flags are enabled?

Additional Information: Are there any specific log levels I need to consider for this scenario? Is there anything else I might be missing in my setup?

*** Edit : For the one who needs , @sfdcfox answers fixed my problem. Thanks

0

2 Answers 2

1

If I had to guess, you created a TraceFlag on the trigger, not the user. TraceFlags on a class or trigger are used to define the levels that will be used for that class or trigger, but without setting a TraceFlag on the user, nothing will be logged at all. Create a new TraceFlag on the user, and you should get debug logs.

0
0
  1. Make sure that the debug level is set to Finest for Apex Code to capture detailed logs for triggers.

  2. Open the Developer Console to monitor real-time logs and check if the trigger execution is being captured there.

Check this helpful documentation.

1
  • One does not need debug log for apex set to finest for trigger debug. That's relevant for use of the Apex Debugger, not for the OP use case of System.debug(xxx)
    – cropredy
    Commented Jun 12 at 22:35

You must log in to answer this question.

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