I have created a class that is related to a form the code does not log
public class QuoteMachinesCartController {
public String opportunityId{set; get;}
public String name{set; get;}
public String paste{set; get;}
//
public Opportunity getOpportunity() {
if(opportunityId == null) {
opportunityId = ApexPages.currentPage().getParameters().get('OpportunityId');
}
return [select Id, Name, AccountId from Opportunity where Id=:opportunityId];
}
public Account getAccount() {
System.debug('Find account');
String id = getOpportunity().AccountId;
return [select Id, Language__c from Account where Id = :id];
}
//Database.Query(strSoql); Use this for creating string queries for SOQL
public PageReference save() {
System.debug('Saving data in QuoteMachinesCartController');
Pricebook2 pb = [select Id from Pricebook2 where isStandard=true limit 1];
Quote q = new Quote(Name=name, OpportunityId=opportunityId, Pricebook2Id=pb.Id);
insert q;
String pid = '';
// items
List<String> items = paste.split(':::::');
// Product2Id, Descripcion, Quantity, Price
for(String item : items ) {
List<String> params = item.split(':::');
pid = params[0];
PricebookEntry pbook = [SELECT Id FROM PricebookEntry WHERE Product2Id = :pid];
QuoteLineItem qi = new QuoteLineItem(
QuoteId = q.Id,
PricebookEntryId= pbook.Id,
Description = params[1],
Quantity = Decimal.valueOf(params[2]),
UnitPrice = Decimal.valueOf(params[3])
);
insert qi;
}
PageReference page = new ApexPages.StandardController(q).view();
page.setRedirect(true);
return page;
}
}
As you can see I have System.debug
in my methods but when I go to Setup > Monitor > Debug Logs I don't see anything, I'm working on a sandbox.
System.debug(LoggingLevel.Error, 'Hello');
– Daniel Ballinger Sep 25 '13 at 2:42