• Shabu Thomas 12
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,
I ma developing a personal application. In it, my code is doing the following:
- Create a debug log level, if it is not there. If it is there, fetch it
- Create a user trace flag with the above debug log level, if it is not for logged in user. If it is there, reset the start and end time
- use system.debug in many places

So, my expectation is that a user trace flag will be automatically created or reset, when this code is executed.
The first two steps are being executed successfully.

But...

For the first time, that is, when the user trace flag will be created, no debug log will be generated. But for the subsequent executions, debug logs will be created as the user trace flag is already there.

That, I observed that no debug logs will be generated in a transaction for a user trace flag, if that user trace flag is dynamically created in same transaction. Is there any way to overcome this issue?

Thanks in advance.
Shabu
Hi,
I ma developing a personal application. In it, my code is doing the following:
- Create a debug log level, if it is not there. If it is there, fetch it
- Create a user trace flag with the above debug log level, if it is not for logged in user. If it is there, reset the start and end time
- use system.debug in many places

So, my expectation is that a user trace flag will be automatically created or reset, when this code is executed.
The first two steps are being executed successfully.

But...

For the first time, that is, when the user trace flag will be created, no debug log will be generated. But for the subsequent executions, debug logs will be created as the user trace flag is already there.

That, I observed that no debug logs will be generated in a transaction for a user trace flag, if that user trace flag is dynamically created in same transaction. Is there any way to overcome this issue?

Thanks in advance.
Shabu