+ Start a Discussion
JHAJHA 

system.debug

// Method

 

public pagereference showmsg(){
//ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'asdf'));
system.debug('asdfasdf');
return null;
}

Im calling above method on button click but can't see any result!

 

 setup->monitor->log

 system Log  link near setup.

 

I cant figure out anything here also.

 

can anyone please let me know how to  use

 

system.debug('asdf') and also how to debug apex code?

 

 

Any one can please help!!

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
JHAJHA

Thanks a lot.

 

Specially for quick and d way you explained.

 

Its really very helpfull.

Message Edited by JHA on 01-12-2010 04:40 AM

All Answers

bob_buzzardbob_buzzard

Setup -> Monitoring -> Debug Logs

 

You will need to create a new entry for your user.

 

Then when you click your button, a new log for the transaction will be created. 

 

There is a lot of information in the debug logs - I'd advised making your debug of the form:

 

System.debug('############# asasdasd');

 

as that way its easier to spot.

 

Also, you can only retain 20 logs - once you have 20 logs, your logging will stop.  Best to get in the habit of resetting your log count each time you view the log.

 

Finally, making a change through the Force IDE and uploading to the server can burn most of your debug logs - always check/reset after uploading if you want to capture debug information. 

JHAJHA

Thanks a lot.

 

Specially for quick and d way you explained.

 

Its really very helpfull.

Message Edited by JHA on 01-12-2010 04:40 AM
This was selected as the best answer
bob_buzzardbob_buzzard
No problem.  Feel free to mark that post as the solution :smileywink: