Common APEX And Visualforce Errors And Solutions
Problem : no viable alternative at character Solution : Make sure you don't mention enclose Strings with double quotes. quotes should be enclosed in single quotes. Opportunity.Description__c='ABCD' NOT Opportunity.Description__c="ABCD" Problem : Returning PageReference doesn't redirect to detail page Solution (Possible): Make sure DML statement insert or update is done before preparing and returning page reference. insert request; PageReference pPage=new ApexPages.StandardController(request).view(); pPage.setRedirect(true); insert request; return pPage; Problem: Incorrect code coverage OR Comments are considered for code coverage. OR Strange issues with code coverage. Workaround: The solution to this problem is clearing the test Results log at the path http://xyz.salesforce.com/07M where xyz is salesforce instance (ex: cs1,ap1 etc) or Go to Setup>Develop>Apex Test Execution>View Test History...