• Thomas Dehli
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I have some custom Apex classes that are failing to save Opportunitty records when a certain flow is enabled in the process builder. When I disable the process in Process Builder, everything starts working again.

The error I get is:
Update failed. First exception on row 0 with id 0063800000WBq80AAD; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow.

java.lang.IllegalArgumentException: unable to find field dataType for complex reference

Error is in expression '{!saveOpp}' in page editexecutivesummary: Class.OpportunityExecutiveSummaryController.saveOpp: line 128, column 1
I need some help figuring out why my Apex class is failing on all opportunities in any stage, as my process in Process Builder is not even suppose to fire until 'Closed Won' is TRUE.

The methos that is failing:
//METHOD: THAT SAVE THE OPPORTUNITY AND CALL THE CONGA MERGE.
    public PageReference saveOpp(){
        if(exe_summary != null && exe_summary.trim().length() > 0){
            opp.Executive_Summary_R__c = exe_summary;
            //exe_summary = exe_summary.replace('<p>','').replace('</p>','\n').replace('<br />','\n').replace('<br>','\n').replace('\'','');
            //exe_summary = exe_summary.replace('<[^>]+>',' ').replace('&amp;','&').replace('&lt;','<').replace('&gt;','>').replace('&quot;','"').replace('&#39;','\'').replace('&nbsp;',' ');
            opp.Executive_Summary__c = mergeFieldValues(exe_summary);            
        }
        
        if(!checkDouble(String.ValueOf(opp.Estimated_Travel_Costs__c))){
            opp.Estimated_Travel_Costs__c = 0;
        }
        update opp;
        return new PageReference('/apex/EditExecutiveSummary?updated=true&id='+opp_id).setRedirect(true);
    }



 
I have some custom Apex classes that are failing to save Opportunitty records when a certain flow is enabled in the process builder. When I disable the process in Process Builder, everything starts working again.

The error I get is:
Update failed. First exception on row 0 with id 0063800000WBq80AAD; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow.

java.lang.IllegalArgumentException: unable to find field dataType for complex reference

Error is in expression '{!saveOpp}' in page editexecutivesummary: Class.OpportunityExecutiveSummaryController.saveOpp: line 128, column 1
I need some help figuring out why my Apex class is failing on all opportunities in any stage, as my process in Process Builder is not even suppose to fire until 'Closed Won' is TRUE.

The methos that is failing:
//METHOD: THAT SAVE THE OPPORTUNITY AND CALL THE CONGA MERGE.
    public PageReference saveOpp(){
        if(exe_summary != null && exe_summary.trim().length() > 0){
            opp.Executive_Summary_R__c = exe_summary;
            //exe_summary = exe_summary.replace('<p>','').replace('</p>','\n').replace('<br />','\n').replace('<br>','\n').replace('\'','');
            //exe_summary = exe_summary.replace('<[^>]+>',' ').replace('&amp;','&').replace('&lt;','<').replace('&gt;','>').replace('&quot;','"').replace('&#39;','\'').replace('&nbsp;',' ');
            opp.Executive_Summary__c = mergeFieldValues(exe_summary);            
        }
        
        if(!checkDouble(String.ValueOf(opp.Estimated_Travel_Costs__c))){
            opp.Estimated_Travel_Costs__c = 0;
        }
        update opp;
        return new PageReference('/apex/EditExecutiveSummary?updated=true&id='+opp_id).setRedirect(true);
    }