• Nikita Petrov
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi Friends,
Is it possible or easy way to do System.Debug dynamic SOQL statements, want to know what will be the internal parameters build in the query before executing
For eg:
 
trigger AccountDeletion on Account (before delete) {
   
    // Prevent the deletion of accounts if they have related opportunities.
    for (Account a : [SELECT Id FROM Account
                     WHERE Id IN (SELECT AccountId FROM Opportunity) AND
                     Id IN :Trigger.old]) {
        Trigger.oldMap.get(a.Id).addError(
            'Cannot delete account with related opportunities.');
    }
    
}


Can somebody provide a sample code to have a debug log in the For loop, so I can know what are the parameters get passed.
or is there any way the SOQL query to be passed to a string so I can see what's going on.

Thanks,
James George