You need to sign in to do that
Don't have an account?

How to view the variable value using System.debug in apex class
Hello All,
Like in java if we want to see the variable value while debuging the code or after running the application
we put System.out.println('') statement to monitor the value on console.
In Apex how to monitor this value using System.debug since we dont have console here..
Can anybody tell me the way with simple example i.e Class with the only System.debug statement.
Thanks,
Sandip
Hi Sandip,
You simply include a line such as
System.debug('The value is: ' + theValue);
And then in your sidebar, under Administration go to Monitoring -> Debug Logs. You have to click on 'new' and add the user as whom the script will be running in order to capture the log output. Then after running the code, refresh the logs list and view the log to see the output.
Regards,
Alex
All Answers
Hi Sandip,
You simply include a line such as
System.debug('The value is: ' + theValue);
And then in your sidebar, under Administration go to Monitoring -> Debug Logs. You have to click on 'new' and add the user as whom the script will be running in order to capture the log output. Then after running the code, refresh the logs list and view the log to see the output.
Regards,
Alex
Super!! Thanks.