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:


Cheers!!!

1 comment:

  1. There is great tool for show nicer data which you parse. for example if you have 200 lines of records, it's hard to check them. Use http://www.cassacloud.com/nice-salesforce-debug/ which parse your salesforce log into nice output

    ReplyDelete