function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Wendy SadehWendy Sadeh 

Updating Opportunity StageName with custom extension

On the opportunity I have a custom button that does some verification and if the verification passes, I want to update the stage name.  My update code has no affect.  Below is posted my code snippets.

Here is the apext code:
<apex:page standardController="Opportunity" extensions="CustomOpportunitySaveExtension">
   <apex:form >
       <apex:pageBlock title="Opportunity Submission">
           <apex:pageBlockSection title="Please fill the below fields before submitting the Opportunity form" columns="1">
           
           <apex:outputText style="color:red" value="{!CheckAndValidate}" escape="false"/>
          
           <apex:commandButton value="Go Back to Opportunity Form" action="{!getBack}"/>

           </apex:pageBlockSection>
       </apex:pageBlock>    
   </apex:form> 
</apex:page>
 
public class CustomOpportunitySaveExtension
{

 private final Opportunity opp;

    private final ApexPages.StandardController oController;
 public Id OpportunityId {get; set;}
  
 public CustomOpportunitySaveExtension (ApexPages.StandardController stdController) 
 {
     this.opp = (Opportunity)stdController.getRecord();
     this.oController = stdController;
 }

 public PageReference getBack()
 {
     String refUrl;
     refUrl = '/'+ opp.Id ;
     PageReference ref = new PageReference(refUrl);    
     ref.setRedirect(true);
     return ref;
 }
 
 public String getCheckAndValidate() 
 {
      List<Opportunity> opportunitylst = [
          SELECT Id, Name, PACEPartner_Project_Number__c, Transaction_Manager__c, StageName,   FROM Opportunity WHERE Id = :opp.Id     
           LIMIT 1
        ];
     
      Opportunity opportunity;

      String validationMessage = '';
      Boolean isMissed = false;
              
      if ( opportunitylst.size() > 0 ) 
      {
        opportunity = opportunitylst[0];
          
          system.debug('Oppurtunity Name : ' + opportunity.Name);
        
        // Project Status - Section Starts
        
        if(opportunity.Name == null)
        {
            validationMessage += 'Project Name - Opportunity Name';
            isMissed = true;
        }
        if(!isMissed)
        {
           // This is where I want to update the stage name.  It has no affect.
            opportunity.StageName = 'Qualified Lead';
            oController.save();

            validationMessage += 'Your application is submitted successfully';
        }
     }

 
Best Answer chosen by Wendy Sadeh
Mahesh DMahesh D
Please see my previous code:

Line number 4: 

public String validationMessage {get; set;}

All Answers

Mahesh DMahesh D
Hi Wendy,

Please replace the below code and verify the same.
 
public class CustomOpportunitySaveExtension {

	public Opportunity opp;
	public String validationMessage {get; set;}
	
	public CustomOpportunitySaveExtension (ApexPages.StandardController stdController) {
		this.opp = (Opportunity)stdController.getRecord();
    }

	public PageReference getBack() {
		String refUrl = '/'+ opp.Id;
		PageReference ref = new PageReference(refUrl);    
		ref.setRedirect(true);
		return ref;
	}
 
	public String getCheckAndValidate() {
		if(opp.Id != null) {
			opp = [ SELECT Id, Name, PACEPartner_Project_Number__c, Transaction_Manager__c, StageName FROM Opportunity WHERE Id = :opp.Id LIMIT 1];
		    
			if(opportunity.Name == null || opportunity.Name == '') {
				validationMessage += 'Project Name - Opportunity Name';
            } else {
				opp.StageName = 'Qualified Lead';
				update opp;
                validationMessage += 'Your application is submitted successfully';
            }
        }
    }
}

Regards,
Mahesh
Wendy SadehWendy Sadeh
Hi Mahesh,

Thanks for the quick reply.

When I change it to update opp;  and run the code in my sandbox I get "Error: Error occurred while loading a Visualforce page. ".  

I am not sure where to look for a "live" debug log.  When I run tests I can see my debug log, but not when I am viewing pages in my sandbox instance.

-w
Mahesh DMahesh D
Go to Setup --> Monitoring --> Debug --> Add your user into it.

And preview the VF page by passing the Opportunity Id;

Something like below:

https://cs40.salesforce.com/apex/VFPageName?Id=006a000000v3iw6

If you can send me the proper error message, it will be easy to fix it.
Wendy SadehWendy Sadeh

Thank you for solving the mystery of debug logs!

Here is the message:  
DML currently not allowed
 
Log	
36.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
20:13:23.0 (82283)|EXECUTION_STARTED
20:13:23.0 (120091)|CODE_UNIT_STARTED|[EXTERNAL]|066j0000000PrrB|VF: /apex/CustomSaveOpportunity
20:13:23.0 (15306434)|CODE_UNIT_STARTED|[EXTERNAL]|01pj0000000Dtie|CustomOpportunitySaveExtension <init>
20:13:23.0 (15323219)|SYSTEM_MODE_ENTER|true
20:13:23.0 (15918879)|HEAP_ALLOCATE|[72]|Bytes:3
20:13:23.0 (15986041)|HEAP_ALLOCATE|[77]|Bytes:152
20:13:23.0 (16005481)|HEAP_ALLOCATE|[342]|Bytes:408
20:13:23.0 (16025612)|HEAP_ALLOCATE|[355]|Bytes:408
20:13:23.0 (16043301)|HEAP_ALLOCATE|[467]|Bytes:48
20:13:23.0 (16083709)|HEAP_ALLOCATE|[139]|Bytes:6
20:13:23.0 (16108076)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:92
20:13:23.0 (16112873)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:9
20:13:23.0 (16115494)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:11
20:13:23.0 (16133377)|METHOD_ENTRY|[1]|01pj0000000Dtie|CustomOpportunitySaveExtension.CustomOpportunitySaveExtension()
20:13:23.0 (16139674)|STATEMENT_EXECUTE|[1]
20:13:23.0 (16148448)|STATEMENT_EXECUTE|[1]
20:13:23.0 (16156061)|METHOD_EXIT|[1]|CustomOpportunitySaveExtension
20:13:23.0 (16225689)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:16
20:13:23.0 (16246332)|VARIABLE_SCOPE_BEGIN|[9]|this|CustomOpportunitySaveExtension|true|false
20:13:23.0 (16328208)|VARIABLE_ASSIGNMENT|[9]|this|{}|0x1196f0a2
20:13:23.0 (16335316)|VARIABLE_SCOPE_BEGIN|[9]|stdController|ApexPages.StandardController|true|false
20:13:23.0 (16488547)|VARIABLE_ASSIGNMENT|[9]|stdController|"StandardController [null]"|0x7cb3f77d
20:13:23.0 (16497950)|STATEMENT_EXECUTE|[1]
20:13:23.0 (16500211)|STATEMENT_EXECUTE|[4]
20:13:23.0 (16502317)|STATEMENT_EXECUTE|[6]
20:13:23.0 (16503291)|STATEMENT_EXECUTE|[7]
20:13:23.0 (16512868)|HEAP_ALLOCATE|[11]|Bytes:6
20:13:23.0 (16563345)|STATEMENT_EXECUTE|[10]
20:13:23.0 (16565616)|STATEMENT_EXECUTE|[11]
20:13:23.0 (36263071)|HEAP_ALLOCATE|[11]|Bytes:8
20:13:23.0 (36311054)|HEAP_ALLOCATE|[50]|Bytes:5
20:13:23.0 (36334569)|HEAP_ALLOCATE|[56]|Bytes:5
20:13:23.0 (36343638)|HEAP_ALLOCATE|[64]|Bytes:7
20:13:23.0 (36419316)|VARIABLE_ASSIGNMENT|[11]|this.opp|{"s":1,"v":{"Id":"0067A000002JnmWQAS"}}|0x1196f0a2
20:13:23.0 (36423900)|STATEMENT_EXECUTE|[12]
20:13:23.0 (36537907)|VARIABLE_ASSIGNMENT|[12]|this.oController|"StandardController [[Opportunity (Id:0067A000002JnmWQAS)]]"|0x1196f0a2
20:13:23.0 (36560660)|CODE_UNIT_FINISHED|CustomOpportunitySaveExtension <init>
20:13:23.0 (56837245)|CODE_UNIT_STARTED|[EXTERNAL]|01pj0000000Dtie|CustomOpportunitySaveExtension get(CheckAndValidate)
20:13:23.0 (56853695)|SYSTEM_MODE_ENTER|true
20:13:23.0 (56888281)|CODE_UNIT_STARTED|[EXTERNAL]|01pj0000000Dtie|CustomOpportunitySaveExtension invoke(getCheckAndValidate)
20:13:23.0 (56942475)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:16
20:13:23.0 (56955611)|VARIABLE_SCOPE_BEGIN|[24]|this|CustomOpportunitySaveExtension|true|false
20:13:23.0 (57105406)|VARIABLE_ASSIGNMENT|[24]|this|{"oController":"StandardController [[Opportunity (Id:0067A000002JnmWQAS)]]","opp":"0x7439c151"}|0x1196f0a2
20:13:23.0 (57125024)|STATEMENT_EXECUTE|[25]
20:13:23.0 (57127222)|STATEMENT_EXECUTE|[26]
20:13:23.0 (57131762)|HEAP_ALLOCATE|[26]|Bytes:4029
20:13:23.0 (57148122)|HEAP_ALLOCATE|[26]|Bytes:4
20:13:23.0 (57164644)|HEAP_ALLOCATE|[26]|Bytes:7
20:13:23.0 (59445483)|SOQL_EXECUTE_BEGIN|[26]|Aggregations:0|SELECT Id, Name, PACEPartner_Project_Number__c, Transaction_Manager__c, StageName, Initial_Entry_Date__c, Underwriting_Complete_Date__c, CloseDate, Channel_Partner_Entity__c, PACEPartner_Mailing_Street_Address__c, PACEPartner_Name__c, PACEPartner_Mailing_City__c, PACEPartner_Phone__c, PACEPartner_Mailing_State__c, PACEPartner_Email__c, PACEPartner_Mailing_Zip_Code__c, PACEPartner_Relationship_to_Owner__c, Type_of_Improvements__c, Physical_Address__c, Municipality__c, Property_Acquisition_Date__c, Property_State_c__c, Property_Purchase_Price__c, Zip_Code__c, Property_Market_Value_Est__c, Description_of_Improvements__c, County__c, Property_Market_Value_Based_Upon__c, Primary_Property_Type__c, Total_Annual_Property_Tax_Pmt__c, Property_Use_Description__c, Property_Parcel_Number__c, Occupancy_Rate__c, Net_Operating_Income__c, Number_of_Tenants__c, Owner_Occupied__c, Years_in_Business_Location__c, Is_there_a_groundlease_in_place__c, If_groundlease_expiration_date__c, Name_of_Land_Owner__c, Property_Owner_Entity_Type__c, Owner_Mailing_Street_Address__c, AccountID, Owner_Mailing_City__c, Legal_Name_of_Property_Owner__c, Owner_Mailing_State__c, Owner_Tax_ID__c, Owner_Mailing_Zip_Code__c, Property_Owner_Main_Contact__c, Property_Owner_Main_Contact_Phone__c, Property_Owner_Main_Contact_Title__c, Property_Owner_Main_Contact_Email__c, Business_Revenue__c, Current_Assets__c, Cost_of_Goods_Sold__c, Current_Liabilities__c, Business_Net_Operating_Income__c, Total_Assets_of_Owner_Occupant__c, Total_Liabilities__c, Intangible_Assets_of_Owner_Occupant__c, First_Mortgage__c, Mortgage_Lender__c, Type_of_Loan_First__c, Type_of_Financing_First__c, Current_Balance_First_Mortgage__c, First_Mortgage_Lender_Contact_Name__c, Interest_Rate_1st__c, First_Mortgage_Lender_Contact_Email__c, Annual_1st_Mortgage_Payments__c, First_Mortgage_Lender_Contact_Phone__c, Second_Mortgage__c, Second_Mortgage_Lender__c, Type_of_Loan_Second__c, Type_of_Financing_Second__c, Current_Balance_Second_Mortgage__c, Second_Mortgage_Lender_Contact_Name__c, Interest_Rate_2nd__c, Second_Mortgage_Lender_Contact_Email__c, Annual_2nd_Mortgage_Payments__c, Second_Mortgage_Lender_Contact_Phone__c, Type_of_Improvements_Multi__c, Desired_Project_Start_Date__c, Loan_Term__c, Est_Improvement_Cost__c, PACE_payment_amount_est__c, Capitalized_Interest__c, Total_PACE_financing_amount_est__c, Solar_PV_System_Size_kW__c, Estimated_Utility_Rate_Escalation_yr__c, Year_1_Electricity_kWh_Production_Est__c, Avoided_Cost_of_Electricity_ACOE__c, Incentive_Measures_Already_Applied__c, Name_of_Incentive_Program__c, Incentive_Measures_Plan_to_Apply__c, Amount_of_Incentive_est__c, Sensitive_Industries__c, Hazardous_Substances__c, Contamination__c, Regulatory_Government_Actions__c, Pending_Proceedings_or_Lawsuits__c, Risk_Studies_or_Assessments__c, Environmental_Studies_Performed__c, Environmental_Study_Report_Date__c, Environmental_Status_Explanation__c, Mortgage_Delinquencies_or_Default__c, Tax_Defaults_or_Delinquencies__c, Involuntary_Liens__c, Bankruptcy_Proceedings_or_Litigation__c, Property_Status_Explanation__c, Owner_Bankruptcy__c, Owner_as_Defendent__c, Forclosure_Short_Sale_or_Deed_in_Lieu__c, Financial_Crime__c, Owner_Status_Explanation__c, Utility_Bills__c, Year_to_Date_Financial_Statement__c, PACEPartner_Pricing_Proposal_Sent__c, Prior_Two_Full_Year_Financial_Statement__c, PACEPartner_Sale_Contract__c, Rent_Roll_Statement__c, Corporate_Resolution__c, Property_Operating_Statement__c, Recent_Mortgage_Satement_from_Owner__c, Other_Contracts__c, Property_Tax_Bill__c, Business_Tax_Returns__c, Proof_of_Insurance__c, Personal_Tax_Returns__c, Title_Screen__c, Personal_Credit_Report__c, Owner_Screen__c, Lender_Consent_Package__c, Contractor_Acknowledgement_Form_Solar__c, Lender_Consent_Form_Executed__c, Contractor_Acknowledgement_Form_Other__c, Plans_and_Specifications_Solar__c, Plans_and_Specifications_Other__c, Officer_s_Certification_Package__c, Program_Application__c, Property_Photo__c FROM Opportunity WHERE Id = :tmpVar1 LIMIT 1
20:13:23.0 (72854630)|SOQL_EXECUTE_END|[26]|Rows:1
20:13:23.0 (72876412)|HEAP_ALLOCATE|[26]|Bytes:8
20:13:23.0 (72910769)|HEAP_ALLOCATE|[26]|Bytes:5569
20:13:23.0 (73089793)|HEAP_ALLOCATE|[26]|Bytes:8
20:13:23.0 (73106113)|VARIABLE_SCOPE_BEGIN|[26]|opportunitylst|List<Opportunity>|true|false
20:13:23.0 (73312140)|VARIABLE_ASSIGNMENT|[26]|opportunitylst|{"s":1,"v":[{"s":2,"v":{"Id":"0067A000002JnmWQAS","Name":"Horse Ranch - Specia (5 more) ...","PACEPartner_Project_ (9 more) ...":"12343","Transaction_Manager_ (2 more) ...":"005j000000CAYj4AAH","StageName":"Pre-Qualified Lead","Initial_Entry_Date__ (1 more) ...":"2016-02-23T00:00:00.000Z","CloseDate":"2016-05-23T00:00:00.000Z","Channel_Partner_Enti (5 more) ...":"0017A00000AC32DQAT","PACEPartner_Mailing_ (17 more) ...":"3055 Clearview Way","PACEPartner_Name__c":"0037A000008eRH5QAM","PACEPartner_Mailing_ (7 more) ...":"San Mateo","PACEPartner_Phone__c":"(415) 555-8888","PACEPartner_Mailing_ (8 more) ...":"CA","PACEPartner_Email__c":"wendy.sadeh@gmail.co (1 more) ...","PACEPartner_Mailing_ (11 more) ...":"94402-3709","PACEPartner_Relation (16 more) ...":"Contractor","Physical_Address__c":"123 Main","Municipality__c":"Juniper","Property_Acquisition (8 more) ...":"2016-02-23T00:00:00.000Z","Property_State_c__c":"FL","Property_Purchase_Pr (6 more) ...":800000,"Zip_Code__c":"02543","Property_Market_Valu (8 more) ...":60000000.00,"Description_of_Impro (10 more) ...":"this is the kind of  (23 more) ...","County__c":"Dade","Property_Market_Valu (15 more) ...":"Guesstimate","Primary_Property_Typ (4 more) ...":"Retail-Anchored","Total_Annual_Propert (12 more) ...":60000,"Property_Use_Descrip (7 more) ...":"this is how the prop (18 more) ...","Property_Parcel_Numb (5 more) ...":"789339,880990","Occupancy_Rate__c":100.00,"Net_Operating_Income (3 more) ...":20000.00,"Number_of_Tenants__c":0,"Owner_Occupied__c":"Yes","Years_in_Business_Lo (9 more) ...":12,"Is_there_a_groundlea (14 more) ...":"Yes","If_groundlease_expir (13 more) ...":"2016-02-23T00:00:00.000Z","Name_of_Land_Owner__ (1 more) ...":"Bundy","Property_Owner_Entit (9 more) ...":"LLC","Owner_Mailing_Street (11 more) ...":"Silly Sally Kelly","AccountId":"0017A00000AasSqQAJ","Owner_Mailing_City__ (1 more) ...":"Portal","Owner_Mailing_State_ (2 more) ...":"FL","Owner_Tax_ID__c":"778899","Owner_Mailing_Zip_Co (5 more) ...":"02143","Property_Owner_Main_ (10 more) ...":"0037A000009OjilQAC","Property_Owner_Main_ (16 more) ...":"(555) 555-1212","Property_Owner_Main_ (16 more) ...":"VP of Solar","Property_Owner_Main_ (16 more) ...":"ghost@example.com","Business_Revenue__c":300000.00,"Current_Assets__c":500000.00,"Cost_of_Goods_Sold__ (1 more) ...":200000.00,"Current_Liabilities_ (2 more) ...":100000.00,"Business_Net_Operati (12 more) ...":100000.00,"Total_Assets_of_Owne (13 more) ...":1000000,"Total_Liabilities__c":13000,"Intangible_Assets_of (18 more) ...":0.00,"First_Mortgage__c":"No","Mortgage_Lender__c":"0017A00000ADoI7QAL","Type_of_Loan_First__ (1 more) ...":"Permanent","Type_of_Financing_Fi (6 more) ...":"CMBS","Current_Balance_Firs (13 more) ...":60000.00,"First_Mortgage_Lende (17 more) ...":"0037A000009OjilQAC","Interest_Rate_1st__c":2.300,"First_Mortgage_Lende (18 more) ...":"jasper@example.com","Annual_1st_Mortgage_ (11 more) ...":13000.00,"First_Mortgage_Lende (18 more) ...":"jasper@example.com","Second_Mortgage__c":"No","Type_of_Improvements (9 more) ...":"Solar","Desired_Project_Star (9 more) ...":"2016-02-24T00:00:00.000Z","Loan_Term__c":20,"Est_Improvement_Cost (3 more) ...":90000.00,"PACE_payment_amount_ (6 more) ...":500000.00,"Capitalized_Interest (3 more) ...":100000.00,"Total_PACE_financing (14 more) ...":20000.00,"Solar_PV_System_Size (6 more) ...":300,"Estimated_Utility_Ra (19 more) ...":10.00,"Year_1_Electricity_k (20 more) ...":200,"Avoided_Cost_of_Elec (15 more) ...":100000.00,"Incentive_Measures_A (17 more) ...":"Yes","Name_of_Incentive_Pr (8 more) ...":"PACING","Incentive_Measures_P (15 more) ...":"No","Amount_of_Incentive_ (6 more) ...":10.00,"Sensitive_Industries (3 more) ...":"No","Hazardous_Substances (3 more) ...":"No","Contamination__c":"No","Regulatory_Governmen (12 more) ...":"No","Pending_Proceedings_ (14 more) ...":"No","Risk_Studies_or_Asse (10 more) ...":"No","Environmental_Status (15 more) ...":"lalalala","Mortgage_Delinquenci (16 more) ...":"Yes","Tax_Defaults_or_Deli (12 more) ...":"No","Involuntary_Liens__c":"No","Bankruptcy_Proceedin (19 more) ...":"No","Property_Status_Expl (10 more) ...":"its turtles all the  (8 more) ...","Owner_Bankruptcy__c":"No","Owner_as_Defendent__ (1 more) ...":"No","Forclosure_Short_Sal (20 more) ...":"No","Financial_Crime__c":"No","Owner_Status_Explana (7 more) ...":"abc","Utility_Bills__c":true,"Year_to_Date_Financi (15 more) ...":true,"PACEPartner_Pricing_ (16 more) ...":true,"Prior_Two_Full_Year_ (22 more) ...":true,"PACEPartner_Sale_Con (8 more) ...":true,"Rent_Roll_Statement_ (2 more) ...":true,"Corporate_Resolution (3 more) ...":true,"Property_Operating_S (11 more) ...":true,"Recent_Mortgage_Sate (18 more) ...":true,"Other_Contracts__c":true,"Property_Tax_Bill__c":true,"Business_Tax_Returns (3 more) ...":false,"Proof_of_Insurance__ (1 more) ...":true,"Personal_Tax_Returns (3 more) ...":false,"Title_Screen__c":true,"Personal_Credit_Repo (5 more) ...":false,"Owner_Screen__c":true,"Lender_Consent_Packa (5 more) ...":true,"Contractor_Acknowled (20 more) ...":true,"Lender_Consent_Form_ (11 more) ...":true,"Contractor_Acknowled (20 more) ...":true,"Plans_and_Specificat (13 more) ...":true,"Plans_and_Specificat (13 more) ...":true,"Officer_s_Certificat (14 more) ...":true,"Program_Application_ (2 more) ...":true,"Property_Photo__c":true}}]}|0x2c36dcc0
20:13:23.0 (73342762)|STATEMENT_EXECUTE|[93]
20:13:23.0 (73349475)|VARIABLE_SCOPE_BEGIN|[93]|opportunity|Opportunity|true|false
20:13:23.0 (73359270)|VARIABLE_ASSIGNMENT|[93]|opportunity|null|
20:13:23.0 (73361510)|STATEMENT_EXECUTE|[95]
20:13:23.0 (73367258)|VARIABLE_SCOPE_BEGIN|[95]|validationMessage|String|false|false
20:13:23.0 (73372627)|VARIABLE_ASSIGNMENT|[95]|validationMessage|""
20:13:23.0 (73374563)|STATEMENT_EXECUTE|[96]
20:13:23.0 (73383687)|VARIABLE_SCOPE_BEGIN|[96]|isMissed|Boolean|false|false
20:13:23.0 (73404639)|HEAP_ALLOCATE|[96]|Bytes:5
20:13:23.0 (73410885)|VARIABLE_ASSIGNMENT|[96]|isMissed|false
20:13:23.0 (73528671)|STATEMENT_EXECUTE|[99]
20:13:23.0 (73531407)|STATEMENT_EXECUTE|[100]
20:13:23.0 (73555492)|HEAP_ALLOCATE|[100]|Bytes:508
20:13:23.0 (73721989)|VARIABLE_ASSIGNMENT|[100]|opportunity|{"s":1,"v":{"Id":"0067A000002JnmWQAS","Name":"Horse Ranch - Specia (5 more) ...","PACEPartner_Project_ (9 more) ...":"12343","Transaction_Manager_ (2 more) ...":"005j000000CAYj4AAH","StageName":"Pre-Qualified Lead","Initial_Entry_Date__ (1 more) ...":"2016-02-23T00:00:00.000Z","CloseDate":"2016-05-23T00:00:00.000Z","Channel_Partner_Enti (5 more) ...":"0017A00000AC32DQAT","PACEPartner_Mailing_ (17 more) ...":"3055 Clearview Way","PACEPartner_Name__c":"0037A000008eRH5QAM","PACEPartner_Mailing_ (7 more) ...":"San Mateo","PACEPartner_Phone__c":"(415) 555-8888","PACEPartner_Mailing_ (8 more) ...":"CA","PACEPartner_Email__c":"wendy.sadeh@gmail.co (1 more) ...","PACEPartner_Mailing_ (11 more) ...":"94402-3709","PACEPartner_Relation (16 more) ...":"Contractor","Physical_Address__c":"123 Main","Municipality__c":"Juniper","Property_Acquisition (8 more) ...":"2016-02-23T00:00:00.000Z","Property_State_c__c":"FL","Property_Purchase_Pr (6 more) ...":800000,"Zip_Code__c":"02543","Property_Market_Valu (8 more) ...":60000000.00,"Description_of_Impro (10 more) ...":"this is the kind of  (23 more) ...","County__c":"Dade","Property_Market_Valu (15 more) ...":"Guesstimate","Primary_Property_Typ (4 more) ...":"Retail-Anchored","Total_Annual_Propert (12 more) ...":60000,"Property_Use_Descrip (7 more) ...":"this is how the prop (18 more) ...","Property_Parcel_Numb (5 more) ...":"789339,880990","Occupancy_Rate__c":100.00,"Net_Operating_Income (3 more) ...":20000.00,"Number_of_Tenants__c":0,"Owner_Occupied__c":"Yes","Years_in_Business_Lo (9 more) ...":12,"Is_there_a_groundlea (14 more) ...":"Yes","If_groundlease_expir (13 more) ...":"2016-02-23T00:00:00.000Z","Name_of_Land_Owner__ (1 more) ...":"Bundy","Property_Owner_Entit (9 more) ...":"LLC","Owner_Mailing_Street (11 more) ...":"Silly Sally Kelly","AccountId":"0017A00000AasSqQAJ","Owner_Mailing_City__ (1 more) ...":"Portal","Owner_Mailing_State_ (2 more) ...":"FL","Owner_Tax_ID__c":"778899","Owner_Mailing_Zip_Co (5 more) ...":"02143","Property_Owner_Main_ (10 more) ...":"0037A000009OjilQAC","Property_Owner_Main_ (16 more) ...":"(555) 555-1212","Property_Owner_Main_ (16 more) ...":"VP of Solar","Property_Owner_Main_ (16 more) ...":"ghost@example.com","Business_Revenue__c":300000.00,"Current_Assets__c":500000.00,"Cost_of_Goods_Sold__ (1 more) ...":200000.00,"Current_Liabilities_ (2 more) ...":100000.00,"Business_Net_Operati (12 more) ...":100000.00,"Total_Assets_of_Owne (13 more) ...":1000000,"Total_Liabilities__c":13000,"Intangible_Assets_of (18 more) ...":0.00,"First_Mortgage__c":"No","Mortgage_Lender__c":"0017A00000ADoI7QAL","Type_of_Loan_First__ (1 more) ...":"Permanent","Type_of_Financing_Fi (6 more) ...":"CMBS","Current_Balance_Firs (13 more) ...":60000.00,"First_Mortgage_Lende (17 more) ...":"0037A000009OjilQAC","Interest_Rate_1st__c":2.300,"First_Mortgage_Lende (18 more) ...":"jasper@example.com","Annual_1st_Mortgage_ (11 more) ...":13000.00,"First_Mortgage_Lende (18 more) ...":"jasper@example.com","Second_Mortgage__c":"No","Type_of_Improvements (9 more) ...":"Solar","Desired_Project_Star (9 more) ...":"2016-02-24T00:00:00.000Z","Loan_Term__c":20,"Est_Improvement_Cost (3 more) ...":90000.00,"PACE_payment_amount_ (6 more) ...":500000.00,"Capitalized_Interest (3 more) ...":100000.00,"Total_PACE_financing (14 more) ...":20000.00,"Solar_PV_System_Size (6 more) ...":300,"Estimated_Utility_Ra (19 more) ...":10.00,"Year_1_Electricity_k (20 more) ...":200,"Avoided_Cost_of_Elec (15 more) ...":100000.00,"Incentive_Measures_A (17 more) ...":"Yes","Name_of_Incentive_Pr (8 more) ...":"PACING","Incentive_Measures_P (15 more) ...":"No","Amount_of_Incentive_ (6 more) ...":10.00,"Sensitive_Industries (3 more) ...":"No","Hazardous_Substances (3 more) ...":"No","Contamination__c":"No","Regulatory_Governmen (12 more) ...":"No","Pending_Proceedings_ (14 more) ...":"No","Risk_Studies_or_Asse (10 more) ...":"No","Environmental_Status (15 more) ...":"lalalala","Mortgage_Delinquenci (16 more) ...":"Yes","Tax_Defaults_or_Deli (12 more) ...":"No","Involuntary_Liens__c":"No","Bankruptcy_Proceedin (19 more) ...":"No","Property_Status_Expl (10 more) ...":"its turtles all the  (8 more) ...","Owner_Bankruptcy__c":"No","Owner_as_Defendent__ (1 more) ...":"No","Forclosure_Short_Sal (20 more) ...":"No","Financial_Crime__c":"No","Owner_Status_Explana (7 more) ...":"abc","Utility_Bills__c":true,"Year_to_Date_Financi (15 more) ...":true,"PACEPartner_Pricing_ (16 more) ...":true,"Prior_Two_Full_Year_ (22 more) ...":true,"PACEPartner_Sale_Con (8 more) ...":true,"Rent_Roll_Statement_ (2 more) ...":true,"Corporate_Resolution (3 more) ...":true,"Property_Operating_S (11 more) ...":true,"Recent_Mortgage_Sate (18 more) ...":true,"Other_Contracts__c":true,"Property_Tax_Bill__c":true,"Business_Tax_Returns (3 more) ...":false,"Proof_of_Insurance__ (1 more) ...":true,"Personal_Tax_Returns (3 more) ...":false,"Title_Screen__c":true,"Personal_Credit_Repo (5 more) ...":false,"Owner_Screen__c":true,"Lender_Consent_Packa (5 more) ...":true,"Contractor_Acknowled (20 more) ...":true,"Lender_Consent_Form_ (11 more) ...":true,"Contractor_Acknowled (20 more) ...":true,"Plans_and_Specificat (13 more) ...":true,"Plans_and_Specificat (13 more) ...":true,"Officer_s_Certificat (14 more) ...":true,"Program_Application_ (2 more) ...":true,"Property_Photo__c":true}}|0x3dc4fbe
20:13:23.0 (73747937)|STATEMENT_EXECUTE|[102]
20:13:23.0 (73752219)|HEAP_ALLOCATE|[102]|Bytes:19
20:13:23.0 (73808195)|HEAP_ALLOCATE|[102]|Bytes:44
20:13:23.0 (73858515)|USER_DEBUG|[102]|DEBUG|Oppurtunity Name : Horse Ranch - Special Use
20:13:23.0 (73871247)|STATEMENT_EXECUTE|[106]
20:13:23.0 (73887963)|STATEMENT_EXECUTE|[111]
20:13:23.0 (73902368)|STATEMENT_EXECUTE|[116]
20:13:23.0 (73914215)|STATEMENT_EXECUTE|[124]
20:13:23.0 (73926597)|STATEMENT_EXECUTE|[129]
20:13:23.0 (73936820)|STATEMENT_EXECUTE|[134]
20:13:23.0 (73948332)|STATEMENT_EXECUTE|[142]
20:13:23.0 (73958992)|STATEMENT_EXECUTE|[147]
20:13:23.0 (73969942)|STATEMENT_EXECUTE|[152]
20:13:23.0 (73979863)|STATEMENT_EXECUTE|[157]
20:13:23.0 (73989257)|STATEMENT_EXECUTE|[162]
20:13:23.0 (73999003)|STATEMENT_EXECUTE|[167]
20:13:23.0 (74007904)|STATEMENT_EXECUTE|[172]
20:13:23.0 (74018396)|STATEMENT_EXECUTE|[177]
20:13:23.0 (74027704)|STATEMENT_EXECUTE|[182]
20:13:23.0 (74037528)|STATEMENT_EXECUTE|[190]
20:13:23.0 (74047042)|STATEMENT_EXECUTE|[195]
20:13:23.0 (74056425)|STATEMENT_EXECUTE|[200]
20:13:23.0 (74095298)|STATEMENT_EXECUTE|[205]
20:13:23.0 (74110722)|STATEMENT_EXECUTE|[210]
20:13:23.0 (74121237)|STATEMENT_EXECUTE|[215]
20:13:23.0 (74131975)|STATEMENT_EXECUTE|[220]
20:13:23.0 (74141506)|STATEMENT_EXECUTE|[225]
20:13:23.0 (74151540)|STATEMENT_EXECUTE|[230]
20:13:23.0 (74161157)|STATEMENT_EXECUTE|[235]
20:13:23.0 (74171619)|STATEMENT_EXECUTE|[240]
20:13:23.0 (74181525)|STATEMENT_EXECUTE|[245]
20:13:23.0 (74190930)|STATEMENT_EXECUTE|[250]
20:13:23.0 (74201722)|STATEMENT_EXECUTE|[255]
20:13:23.0 (74211695)|STATEMENT_EXECUTE|[260]
20:13:23.0 (74241622)|HEAP_ALLOCATE|[266]|Bytes:28
20:13:23.0 (74246264)|STATEMENT_EXECUTE|[266]
20:13:23.0 (74260733)|STATEMENT_EXECUTE|[271]
20:13:23.0 (74272280)|STATEMENT_EXECUTE|[276]
20:13:23.0 (74281906)|STATEMENT_EXECUTE|[284]
20:13:23.0 (74286650)|HEAP_ALLOCATE|[289]|Bytes:3
20:13:23.0 (74312607)|STATEMENT_EXECUTE|[289]
20:13:23.0 (74326774)|STATEMENT_EXECUTE|[290]
20:13:23.0 (74336510)|STATEMENT_EXECUTE|[295]
20:13:23.0 (74346854)|STATEMENT_EXECUTE|[305]
20:13:23.0 (74361007)|STATEMENT_EXECUTE|[310]
20:13:23.0 (74372700)|STATEMENT_EXECUTE|[315]
20:13:23.0 (74382186)|STATEMENT_EXECUTE|[320]
20:13:23.0 (74391282)|STATEMENT_EXECUTE|[330]
20:13:23.0 (74400024)|STATEMENT_EXECUTE|[335]
20:13:23.0 (74409159)|STATEMENT_EXECUTE|[340]
20:13:23.0 (74420606)|STATEMENT_EXECUTE|[349]
20:13:23.0 (74430736)|STATEMENT_EXECUTE|[355]
20:13:23.0 (74440059)|STATEMENT_EXECUTE|[361]
20:13:23.0 (74449139)|STATEMENT_EXECUTE|[367]
20:13:23.0 (74450613)|STATEMENT_EXECUTE|[377]
20:13:23.0 (74453526)|HEAP_ALLOCATE|[377]|Bytes:54
20:13:23.0 (74463180)|HEAP_ALLOCATE|[377]|Bytes:57
20:13:23.0 (74488656)|USER_DEBUG|[377]|DEBUG|This is the value of owner occupied in extention classYes
20:13:23.0 (74508133)|STATEMENT_EXECUTE|[378]
20:13:23.0 (74509858)|STATEMENT_EXECUTE|[380]
20:13:23.0 (74512305)|HEAP_ALLOCATE|[380]|Bytes:56
20:13:23.0 (74584327)|HEAP_ALLOCATE|[380]|Bytes:9
20:13:23.0 (74597675)|HEAP_ALLOCATE|[380]|Bytes:65
20:13:23.0 (74611627)|USER_DEBUG|[380]|DEBUG|This is the value of business revenue in extention class300000.00
20:13:23.0 (74624128)|STATEMENT_EXECUTE|[383]
20:13:23.0 (74641944)|STATEMENT_EXECUTE|[389]
20:13:23.0 (74652907)|STATEMENT_EXECUTE|[395]
20:13:23.0 (74662966)|STATEMENT_EXECUTE|[401]
20:13:23.0 (74674284)|STATEMENT_EXECUTE|[407]
20:13:23.0 (74684712)|STATEMENT_EXECUTE|[413]
20:13:23.0 (74694630)|STATEMENT_EXECUTE|[419]
20:13:23.0 (74707754)|HEAP_ALLOCATE|[425]|Bytes:28
20:13:23.0 (74711623)|STATEMENT_EXECUTE|[425]
20:13:23.0 (74722674)|STATEMENT_EXECUTE|[436]
20:13:23.0 (74735376)|STATEMENT_EXECUTE|[442]
20:13:23.0 (74746966)|STATEMENT_EXECUTE|[500]
20:13:23.0 (74756471)|STATEMENT_EXECUTE|[506]
20:13:23.0 (74767816)|STATEMENT_EXECUTE|[564]
20:13:23.0 (74777712)|STATEMENT_EXECUTE|[569]
20:13:23.0 (74786970)|STATEMENT_EXECUTE|[574]
20:13:23.0 (74798347)|STATEMENT_EXECUTE|[579]
20:13:23.0 (74808581)|STATEMENT_EXECUTE|[584]
20:13:23.0 (74819115)|STATEMENT_EXECUTE|[590]
20:13:23.0 (74829570)|STATEMENT_EXECUTE|[595]
20:13:23.0 (74839990)|STATEMENT_EXECUTE|[600]
20:13:23.0 (74850988)|STATEMENT_EXECUTE|[608]
20:13:23.0 (74861393)|STATEMENT_EXECUTE|[613]
20:13:23.0 (74872689)|STATEMENT_EXECUTE|[618]
20:13:23.0 (74882788)|STATEMENT_EXECUTE|[623]
20:13:23.0 (74892743)|STATEMENT_EXECUTE|[631]
20:13:23.0 (74908466)|STATEMENT_EXECUTE|[637]
20:13:23.0 (74920181)|STATEMENT_EXECUTE|[638]
20:13:23.0 (74931824)|STATEMENT_EXECUTE|[643]
20:13:23.0 (74942180)|STATEMENT_EXECUTE|[650]
20:13:23.0 (74951316)|STATEMENT_EXECUTE|[659]
20:13:23.0 (74960344)|STATEMENT_EXECUTE|[664]
20:13:23.0 (74969307)|STATEMENT_EXECUTE|[669]
20:13:23.0 (74978586)|STATEMENT_EXECUTE|[674]
20:13:23.0 (74987951)|STATEMENT_EXECUTE|[679]
20:13:23.0 (74996922)|STATEMENT_EXECUTE|[684]
20:13:23.0 (75001900)|STATEMENT_EXECUTE|[689]
20:13:23.0 (75011139)|STATEMENT_EXECUTE|[696]
20:13:23.0 (75020587)|STATEMENT_EXECUTE|[704]
20:13:23.0 (75029445)|STATEMENT_EXECUTE|[710]
20:13:23.0 (75038319)|STATEMENT_EXECUTE|[716]
20:13:23.0 (75046956)|STATEMENT_EXECUTE|[722]
20:13:23.0 (75056441)|STATEMENT_EXECUTE|[728]
20:13:23.0 (75065911)|STATEMENT_EXECUTE|[736]
20:13:23.0 (75074949)|STATEMENT_EXECUTE|[741]
20:13:23.0 (75084227)|STATEMENT_EXECUTE|[746]
20:13:23.0 (75093159)|STATEMENT_EXECUTE|[751]
20:13:23.0 (75102454)|STATEMENT_EXECUTE|[756]
20:13:23.0 (75114642)|STATEMENT_EXECUTE|[764]
20:13:23.0 (75125497)|STATEMENT_EXECUTE|[770]
20:13:23.0 (75135783)|STATEMENT_EXECUTE|[776]
20:13:23.0 (75146337)|STATEMENT_EXECUTE|[782]
20:13:23.0 (75156400)|STATEMENT_EXECUTE|[788]
20:13:23.0 (75163497)|HEAP_ALLOCATE|[795]|Bytes:6
20:13:23.0 (75214928)|STATEMENT_EXECUTE|[796]
20:13:23.0 (75238164)|STATEMENT_EXECUTE|[797]
20:13:23.0 (75250690)|STATEMENT_EXECUTE|[805]
20:13:23.0 (75261145)|STATEMENT_EXECUTE|[811]
20:13:23.0 (75271268)|STATEMENT_EXECUTE|[817]
20:13:23.0 (75281963)|STATEMENT_EXECUTE|[823]
20:13:23.0 (75292232)|STATEMENT_EXECUTE|[829]
20:13:23.0 (75304822)|HEAP_ALLOCATE|[836]|Bytes:3
20:13:23.0 (75344719)|STATEMENT_EXECUTE|[835]
20:13:23.0 (75368366)|STATEMENT_EXECUTE|[856]
20:13:23.0 (75379673)|STATEMENT_EXECUTE|[862]
20:13:23.0 (75385799)|HEAP_ALLOCATE|[870]|Bytes:18
20:13:23.0 (75401904)|STATEMENT_EXECUTE|[870]
20:13:23.0 (75405043)|STATEMENT_EXECUTE|[933]
20:13:23.0 (75406198)|STATEMENT_EXECUTE|[934]
20:13:23.0 (75409287)|HEAP_ALLOCATE|[934]|Bytes:14
20:13:23.0 (75497872)|VARIABLE_ASSIGNMENT|[934]|this.StageName|"Qualified Lead"|0x3dc4fbe
20:13:23.0 (75502421)|STATEMENT_EXECUTE|[935]
20:13:23.0 (75545043)|HEAP_ALLOCATE|[935]|Bytes:8
20:13:23.0 (75563008)|DML_BEGIN|[935]|Op:Update|Type:Opportunity|Rows:1
20:13:23.0 (75606204)|EXCEPTION_THROWN|[935]|System.LimitException: DML currently not allowed
20:13:23.0 (75725088)|HEAP_ALLOCATE|[935]|Bytes:29
20:13:23.0 (75813443)|FATAL_ERROR|System.LimitException: DML currently not allowed

Class.CustomOpportunitySaveExtension.getCheckAndValidate: line 935, column 1
20:13:23.0 (75826181)|CODE_UNIT_FINISHED|CustomOpportunitySaveExtension invoke(getCheckAndValidate)
20:13:23.0 (75902995)|CODE_UNIT_FINISHED|CustomOpportunitySaveExtension get(CheckAndValidate)
20:13:23.78 (78952944)|CUMULATIVE_LIMIT_USAGE
20:13:23.78 (78952944)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 1 out of 100
  Number of query rows: 1 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

20:13:23.78 (78952944)|CUMULATIVE_LIMIT_USAGE_END

20:13:23.0 (78999004)|CODE_UNIT_FINISHED|VF: /apex/CustomSaveOpportunity
20:13:23.0 (80370308)|EXECUTION_FINISHED

 
Mahesh DMahesh D
I am not able to understand onething here:

CustomOpportunitySaveExtension.getCheckAndValidate: line 935, column 

You class contains only 30 lines of code and why it is showing line number 935?

Regards,
Mahesh
Wendy SadehWendy Sadeh
Ahh.  Because it is a rather long and boring class.  I abbreivated.  I will post as much as I can, it looks like there are limits.  line 935 is update opp;
public class CustomOpportunitySaveExtension
{

 private final Opportunity opp;

    private final ApexPages.StandardController oController;
 public Id OpportunityId {get; set;}
  
 public CustomOpportunitySaveExtension (ApexPages.StandardController stdController) 
 {
     this.opp = (Opportunity)stdController.getRecord();
     this.oController = stdController;
 }

 public PageReference getBack()
 {
     String refUrl;
     refUrl = '/'+ opp.Id ;
     PageReference ref = new PageReference(refUrl);    
     ref.setRedirect(true);
     return ref;
 }
 
 public String getCheckAndValidate() 
 {
      List<Opportunity> opportunitylst = [
          SELECT Id, Name, PACEPartner_Project_Number__c, Transaction_Manager__c, StageName,  
                 Initial_Entry_Date__c, Underwriting_Complete_Date__c, CloseDate, 
                 Channel_Partner_Entity__c, PACEPartner_Mailing_Street_Address__c, 
                 PACEPartner_Name__c, PACEPartner_Mailing_City__c,
                 PACEPartner_Phone__c, PACEPartner_Mailing_State__c, 
                 PACEPartner_Email__c, PACEPartner_Mailing_Zip_Code__c, 
                 PACEPartner_Relationship_to_Owner__c, Type_of_Improvements__c,
                 Physical_Address__c, Municipality__c, Property_Acquisition_Date__c, 
                 Property_State_c__c, Property_Purchase_Price__c, 
                 Zip_Code__c, Property_Market_Value_Est__c, Description_of_Improvements__c, 
                 County__c, Property_Market_Value_Based_Upon__c,
                 Primary_Property_Type__c, Total_Annual_Property_Tax_Pmt__c,  
                 Property_Use_Description__c, Property_Parcel_Number__c, 
                 Occupancy_Rate__c, Net_Operating_Income__c, 
                 Number_of_Tenants__c, Owner_Occupied__c, Years_in_Business_Location__c,
                 Is_there_a_groundlease_in_place__c, If_groundlease_expiration_date__c, Name_of_Land_Owner__c,
                 Property_Owner_Entity_Type__c, Owner_Mailing_Street_Address__c, 
                 AccountID, Owner_Mailing_City__c,
                 Legal_Name_of_Property_Owner__c, Owner_Mailing_State__c, 
                 Owner_Tax_ID__c, Owner_Mailing_Zip_Code__c,
                 Property_Owner_Main_Contact__c, Property_Owner_Main_Contact_Phone__c, 
                 Property_Owner_Main_Contact_Title__c, Property_Owner_Main_Contact_Email__c, 
                 Business_Revenue__c, Current_Assets__c, Cost_of_Goods_Sold__c, Current_Liabilities__c,
                 Business_Net_Operating_Income__c, Total_Assets_of_Owner_Occupant__c, 
                 Total_Liabilities__c, Intangible_Assets_of_Owner_Occupant__c,
                 First_Mortgage__c, Mortgage_Lender__c, 
                 Type_of_Loan_First__c, Type_of_Financing_First__c,
                 Current_Balance_First_Mortgage__c, First_Mortgage_Lender_Contact_Name__c,
                 Interest_Rate_1st__c, First_Mortgage_Lender_Contact_Email__c, 
                 Annual_1st_Mortgage_Payments__c, First_Mortgage_Lender_Contact_Phone__c,
                 Second_Mortgage__c, Second_Mortgage_Lender__c, 
                 Type_of_Loan_Second__c, Type_of_Financing_Second__c,
                 Current_Balance_Second_Mortgage__c, Second_Mortgage_Lender_Contact_Name__c, 
                 Interest_Rate_2nd__c, Second_Mortgage_Lender_Contact_Email__c, 
                 Annual_2nd_Mortgage_Payments__c, Second_Mortgage_Lender_Contact_Phone__c, 
                 Type_of_Improvements_Multi__c, Desired_Project_Start_Date__c, Loan_Term__c,
                 Est_Improvement_Cost__c, PACE_payment_amount_est__c, 
                 Capitalized_Interest__c, Total_PACE_financing_amount_est__c,
                 Solar_PV_System_Size_kW__c, Estimated_Utility_Rate_Escalation_yr__c, 
                 Year_1_Electricity_kWh_Production_Est__c, Avoided_Cost_of_Electricity_ACOE__c, 
                 Incentive_Measures_Already_Applied__c, Name_of_Incentive_Program__c, 
                 Incentive_Measures_Plan_to_Apply__c, Amount_of_Incentive_est__c,
                 Sensitive_Industries__c, Hazardous_Substances__c, Contamination__c, 
                 Regulatory_Government_Actions__c, Pending_Proceedings_or_Lawsuits__c, 
                 Risk_Studies_or_Assessments__c, Environmental_Studies_Performed__c, 
                 Environmental_Study_Report_Date__c, Environmental_Status_Explanation__c, 
                 Mortgage_Delinquencies_or_Default__c, Tax_Defaults_or_Delinquencies__c,
                 Involuntary_Liens__c, Bankruptcy_Proceedings_or_Litigation__c, Property_Status_Explanation__c, 
                 Owner_Bankruptcy__c, Owner_as_Defendent__c, Forclosure_Short_Sale_or_Deed_in_Lieu__c, 
                 Financial_Crime__c, Owner_Status_Explanation__c, 
                 Utility_Bills__c, Year_to_Date_Financial_Statement__c, 
                 PACEPartner_Pricing_Proposal_Sent__c, Prior_Two_Full_Year_Financial_Statement__c,
                 PACEPartner_Sale_Contract__c, Rent_Roll_Statement__c, Corporate_Resolution__c,
                 Property_Operating_Statement__c, Recent_Mortgage_Satement_from_Owner__c,
                 Other_Contracts__c, Property_Tax_Bill__c, Business_Tax_Returns__c, 
                 Proof_of_Insurance__c, Personal_Tax_Returns__c, Title_Screen__c,
                 Personal_Credit_Report__c, Owner_Screen__c,
                 Lender_Consent_Package__c, Contractor_Acknowledgement_Form_Solar__c,
                 Lender_Consent_Form_Executed__c, Contractor_Acknowledgement_Form_Other__c,
                 Plans_and_Specifications_Solar__c, Plans_and_Specifications_Other__c, 
                 Officer_s_Certification_Package__c, Program_Application__c,
                 Property_Photo__c
           FROM Opportunity WHERE Id = :opp.Id     
           LIMIT 1
        ];
     
      Opportunity opportunity;

      String validationMessage = '';
      Boolean isMissed = false;
              
      if ( opportunitylst.size() > 0 ) 
      {
        opportunity = opportunitylst[0];
          
          system.debug('Oppurtunity Name : ' + opportunity.Name);
        
        // Project Status - Section Starts
        
        if(opportunity.Name == null)
        {
            validationMessage += 'Project Name - Opportunity Name';
            isMissed = true;
        }
       
     ------------- cut lots of code ---------------
        }
                
        if(!isMissed)
        {
            opportunity.StageName = 'Qualified Lead';
line 935           update opp;

            validationMessage += 'Your application is submitted successfully';
        }
    }


     return validationMessage;
 }

 
Mahesh DMahesh D
Change your VF page to below:

<apex:outputText style="color:red" value="{!validationMessage}" escape="false" id="msg"/>

<apex:commandButton value="Save" action="{!getCheckAndValidate}" reRender="msg"/>


In the controller 

public PageReferencegetCheckAndValidate() {
....
.....
return new PageReference('/'+opp.Id);

}
Wendy SadehWendy Sadeh
ok changed the code below.  the VF page is complaining about the validation message since I am no long returning it. 
Error:(1, 1) Unknown property 'OpportunityStandardController.validationMessage'
<apex:page standardController="Opportunity" extensions="CustomOpportunitySaveExtension">
   <apex:form >
       <apex:pageBlock title="Opportunity Submission">
           <apex:pageBlockSection title="Please fill the below fields before submitting the Opportunity form" columns="1">
           
           <!--<apex:outputText style="color:red" value="{!CheckAndValidate}" escape="false"/>-->
          <!---->
           <!--<apex:commandButton value="Go Back to Opportunity Form" action="{!getBack}"/>-->

               <apex:outputText style="color:red" value="{!validationMessage}" escape="false" id="msg"/>

               <apex:commandButton value="Save" action="{!getCheckAndValidate}" reRender="msg"/>


           </apex:pageBlockSection>
       </apex:pageBlock>    
   </apex:form> 
</apex:page>

and controller now:
public class CustomOpportunitySaveExtension
{

 private final Opportunity opp;

    private final ApexPages.StandardController oController;
 public Id OpportunityId {get; set;}
  
 public CustomOpportunitySaveExtension (ApexPages.StandardController stdController) 
 {
     this.opp = (Opportunity)stdController.getRecord();
     this.oController = stdController;
 }

 public PageReference getBack()
 {
     String refUrl;
     refUrl = '/'+ opp.Id ;
     PageReference ref = new PageReference(refUrl);    
     ref.setRedirect(true);
     return ref;
 }
 
// public String getCheckAndValidate()
public PageReference getCheckAndValidate()
 {
      List<Opportunity> opportunitylst = [
          SELECT Id, Name, PACEPartner_Project_Number__c, Transaction_Manager__c, StageName,  
                 Initial_Entry_Date__c, Underwriting_Complete_Date__c, CloseDate, 
                 Channel_Partner_Entity__c, PACEPartner_Mailing_Street_Address__c, 
                 PACEPartner_Name__c, PACEPartner_Mailing_City__c,
                 PACEPartner_Phone__c, PACEPartner_Mailing_State__c, 
                 PACEPartner_Email__c, PACEPartner_Mailing_Zip_Code__c, 
                 PACEPartner_Relationship_to_Owner__c, Type_of_Improvements__c,
                 Physical_Address__c, Municipality__c, Property_Acquisition_Date__c, 
                 Property_State_c__c, Property_Purchase_Price__c, 
                 Zip_Code__c, Property_Market_Value_Est__c, Description_of_Improvements__c, 
                 County__c, Property_Market_Value_Based_Upon__c,
                 Primary_Property_Type__c, Total_Annual_Property_Tax_Pmt__c,  
                 Property_Use_Description__c, Property_Parcel_Number__c, 
                 Occupancy_Rate__c, Net_Operating_Income__c, 
                 Number_of_Tenants__c, Owner_Occupied__c, Years_in_Business_Location__c,
                 Is_there_a_groundlease_in_place__c, If_groundlease_expiration_date__c, Name_of_Land_Owner__c,
                 Property_Owner_Entity_Type__c, Owner_Mailing_Street_Address__c, 
                 AccountID, Owner_Mailing_City__c,
                 Legal_Name_of_Property_Owner__c, Owner_Mailing_State__c, 
                 Owner_Tax_ID__c, Owner_Mailing_Zip_Code__c,
                 Property_Owner_Main_Contact__c, Property_Owner_Main_Contact_Phone__c, 
                 Property_Owner_Main_Contact_Title__c, Property_Owner_Main_Contact_Email__c, 
                 Business_Revenue__c, Current_Assets__c, Cost_of_Goods_Sold__c, Current_Liabilities__c,
                 Business_Net_Operating_Income__c, Total_Assets_of_Owner_Occupant__c, 
                 Total_Liabilities__c, Intangible_Assets_of_Owner_Occupant__c,
                 First_Mortgage__c, Mortgage_Lender__c, 
                 Type_of_Loan_First__c, Type_of_Financing_First__c,
                 Current_Balance_First_Mortgage__c, First_Mortgage_Lender_Contact_Name__c,
                 Interest_Rate_1st__c, First_Mortgage_Lender_Contact_Email__c, 
                 Annual_1st_Mortgage_Payments__c, First_Mortgage_Lender_Contact_Phone__c,
                 Second_Mortgage__c, Second_Mortgage_Lender__c, 
                 Type_of_Loan_Second__c, Type_of_Financing_Second__c,
                 Current_Balance_Second_Mortgage__c, Second_Mortgage_Lender_Contact_Name__c, 
                 Interest_Rate_2nd__c, Second_Mortgage_Lender_Contact_Email__c, 
                 Annual_2nd_Mortgage_Payments__c, Second_Mortgage_Lender_Contact_Phone__c, 
                 Type_of_Improvements_Multi__c, Desired_Project_Start_Date__c, Loan_Term__c,
                 Est_Improvement_Cost__c, PACE_payment_amount_est__c, 
                 Capitalized_Interest__c, Total_PACE_financing_amount_est__c,
                 Solar_PV_System_Size_kW__c, Estimated_Utility_Rate_Escalation_yr__c, 
                 Year_1_Electricity_kWh_Production_Est__c, Avoided_Cost_of_Electricity_ACOE__c, 
                 Incentive_Measures_Already_Applied__c, Name_of_Incentive_Program__c, 
                 Incentive_Measures_Plan_to_Apply__c, Amount_of_Incentive_est__c,
                 Sensitive_Industries__c, Hazardous_Substances__c, Contamination__c, 
                 Regulatory_Government_Actions__c, Pending_Proceedings_or_Lawsuits__c, 
                 Risk_Studies_or_Assessments__c, Environmental_Studies_Performed__c, 
                 Environmental_Study_Report_Date__c, Environmental_Status_Explanation__c, 
                 Mortgage_Delinquencies_or_Default__c, Tax_Defaults_or_Delinquencies__c,
                 Involuntary_Liens__c, Bankruptcy_Proceedings_or_Litigation__c, Property_Status_Explanation__c, 
                 Owner_Bankruptcy__c, Owner_as_Defendent__c, Forclosure_Short_Sale_or_Deed_in_Lieu__c, 
                 Financial_Crime__c, Owner_Status_Explanation__c, 
                 Utility_Bills__c, Year_to_Date_Financial_Statement__c, 
                 PACEPartner_Pricing_Proposal_Sent__c, Prior_Two_Full_Year_Financial_Statement__c,
                 PACEPartner_Sale_Contract__c, Rent_Roll_Statement__c, Corporate_Resolution__c,
                 Property_Operating_Statement__c, Recent_Mortgage_Satement_from_Owner__c,
                 Other_Contracts__c, Property_Tax_Bill__c, Business_Tax_Returns__c, 
                 Proof_of_Insurance__c, Personal_Tax_Returns__c, Title_Screen__c,
                 Personal_Credit_Report__c, Owner_Screen__c,
                 Lender_Consent_Package__c, Contractor_Acknowledgement_Form_Solar__c,
                 Lender_Consent_Form_Executed__c, Contractor_Acknowledgement_Form_Other__c,
                 Plans_and_Specifications_Solar__c, Plans_and_Specifications_Other__c, 
                 Officer_s_Certification_Package__c, Program_Application__c,
                 Property_Photo__c
           FROM Opportunity WHERE Id = :opp.Id     
           LIMIT 1
        ];
     
      Opportunity opportunity;

      String validationMessage = '';
      Boolean isMissed = false;
              
      if ( opportunitylst.size() > 0 ) 
      {
        opportunity = opportunitylst[0];
          
          system.debug('Oppurtunity Name : ' + opportunity.Name);
        
        // Project Status - Section Starts
        
        if(opportunity.Name == null)
        {
            validationMessage += 'Project Name - Opportunity Name';
            isMissed = true;
        }
        if(opportunity.PACEPartner_Project_Number__c == null)
        {
            validationMessage += '<br/>Project Name - PACEPartner Project Number';
            isMissed = true;
        }
    ..... cut ....

         
        if(!isMissed)
        {
            opportunity.StageName = 'Qualified Lead';
           update opp;

            validationMessage += 'Your application is submitted successfully';
        }
    }


//     return validationMessage;
     return new PageReference('/'+opp.Id);
Mahesh DMahesh D
Please see my previous code:

Line number 4: 

public String validationMessage {get; set;}
This was selected as the best answer
Wendy SadehWendy Sadeh
Thanks so much Mahesh.  While your answer did not get me all the way there, it did help show me the way. 

I was getting the error:  DML currently not allowed
You cannot do any data manipulate in a getXXX method.

I altered the code to be:
 
<apex:page standardController="Opportunity" extensions="CustomOpportunitySaveExtension" action="{!CheckAndValidate}">
    <apex:form >
        <apex:pageBlock title="Opportunity Submission">
            <apex:pageBlockSection title="Please fill the below fields before submitting the Opportunity form" columns="1">

                <apex:outputText style="color:red" value="{!validationMessage}" escape="false"/>

                <apex:commandButton value="Go Back to Opportunity Form" action="{!getBack}"/>

            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

and 
public class CustomOpportunitySaveExtension
{

    private final Opportunity opp;
    public Id OpportunityId {get; set;}
   // add the get set method 
    public String validationMessage {get; set;}

    public CustomOpportunitySaveExtension (ApexPages.StandardController stdController)
    {
        this.opp = (Opportunity)stdController.getRecord();
        this.validationMessage='';
    }

.... more code ....

//    instead of String use a void method public String getCheckAndValidate()
    public void CheckAndValidate() {

.... more code ....
       // instead of returning the string set the class variable to be used in the page.
       this.validationMessage = validationMessage;


}