It's not clear is it? :) You can include System.Debug('message') within your code. These debug messages are then available through clicking Setup>Monitoring>Debug logs. Move info is available on that page.
It's not clear is it? :) You can include System.Debug('message') within your code. These debug messages are then available through clicking Setup>Monitoring>Debug logs. Move info is available on that page.
The first key is to ensure you have system.debug messages in your code. Then to output those debug messages, you can use the Debug Logs (mentioned in the previous post), or System Log in the browser. You also can look at the debug output when executing your test methods.
I cant seem to see my System.debug statements on Monitoring->Debug Log.
I am trying to print a dynamic query and its just not printing in there. On clicking the button, Apply Scoring Rule, i dont see any System.debug statements in the log. If you need more detail, i can post my code here.
public void executeLead() {
System.debug('************ Query: ************ ');
if(lead == null) lead = new Lead();
// Get Leads based on the selected Value
String leadQry = 'select FirstName, LastName, NumberOfEmployees,' +
'AnnualRevenue from lead where ' +
fldDate + ' >= ' + StartDate + ' and ' +
fldDate + ' <= ' + EndDate;
System.debug('************ Query: ************ ' + leadQry);
leads = Database.Query(leadQry);
// return leads;
// return null;
}
public List<Lead> getLead() {
return leads;
}
public PageReference ApplyScoringRule() { // Now set the method depending on what it is; // String cMappingRule = getQuery(); // String cQuery = getLead(); System.debug('******HERE*****'); List<Lead> results = getLead(); // If zero or more than 250 records returned, display a message if (results.size() == 250) ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'NOTE: Only the first 250 rows are displayed.')); if (results.size() == 0) ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'NO RECORDS FOUND.'));
// searchResults.add(new showLeads(ld)); for (Lead c : results) { // System.Debug(); searchResults.add( new showLeads(c) ) ; }
Hey
It's not clear is it? :) You can include System.Debug('message') within your code. These debug messages are then available through clicking Setup>Monitoring>Debug logs. Move info is available on that page.
Cheers,
Wes
All Answers
Hey
It's not clear is it? :) You can include System.Debug('message') within your code. These debug messages are then available through clicking Setup>Monitoring>Debug logs. Move info is available on that page.
Cheers,
Wes
The first key is to ensure you have system.debug messages in your code. Then to output those debug messages, you can use the Debug Logs (mentioned in the previous post), or System Log in the browser. You also can look at the debug output when executing your test methods.
Hi wesnolte,
I cant seem to see my System.debug statements on Monitoring->Debug Log.
I am trying to print a dynamic query and its just not printing in there. On clicking the button, Apply Scoring Rule, i dont see any System.debug statements in the log. If you need more detail, i can post my code here.
public void executeLead() { System.debug('************ Query: ************ '); if(lead == null) lead = new Lead(); // Get Leads based on the selected Value String leadQry = 'select FirstName, LastName, NumberOfEmployees,' + 'AnnualRevenue from lead where ' + fldDate + ' >= ' + StartDate + ' and ' + fldDate + ' <= ' + EndDate; System.debug('************ Query: ************ ' + leadQry); leads = Database.Query(leadQry); // return leads; // return null; } public List<Lead> getLead() { return leads; }
public PageReference ApplyScoringRule() {
// Now set the method depending on what it is;
// String cMappingRule = getQuery();
// String cQuery = getLead();
System.debug('******HERE*****');
List<Lead> results = getLead();
// If zero or more than 250 records returned, display a message
if (results.size() == 250) ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'NOTE: Only the first 250 rows are displayed.'));
if (results.size() == 0) ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'NO RECORDS FOUND.'));
// searchResults.add(new showLeads(ld));
for (Lead c : results) {
// System.Debug();
searchResults.add( new showLeads(c) ) ;
}
return null;
// return cQuery;
}
Hey
Do you see anything on that page? The info on the page should be able to help you, but just in case I'd like to ask if
1. You are clicking the 'new' button on that page and adding your user to the debug logs
2. After doing this do you go to your page and click the button?
3. You then have to return to the debug page and refresh it. The most recent entry is probably the relevant one.
Wes