Example for System.debug() in Salesforce

Example for System.debug() in Salesforce

The main use of System.debug() is to track the flow of program and find errors.

Example:

parsedCSVdata = parseCSV(fileString,false);
System.debug(‘Parsed CSV Data –>’ + parsedCSVdata);

To see this go to Setup –> Administration Setup –> Monitoring –> Debug Log
Assign the user and execute the Apex code. Then refresh the debug log page and click view button.

Debug log:

Leave a Reply