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
Rajat Jain 1Rajat Jain 1 

I am calling one method in apex, The method is not running

Hello Everyone,

I am calling one method from another class. I have some Syetm.Debug inside that method and code. I have setup a debug log and I can see the below two entry :

08:40:25.0 (2615966677)|METHOD_ENTRY|[117]|01p12000001RT9U|GE_PW_OpportunityTrigger_LogicHandler.sendMailtToR1MeetingApproved(GE_PW_TriggerContextVariables) 08:40:25.0 (2651856408)|METHOD_EXIT|[117]|01p12000001RT9U|GE_PW_OpportunityTrigger_LogicHandler.sendMailtToR1MeetingApproved(GE_PW_TriggerContextVariables)

The code inside the method is not at all running even the System.debug.
Is anyone have idea what all can be the reason for this ?
Thanks in advance !!

Below is the method that I am calling :

  public static void sendMailtToR1MeetingApproved(GE_PW_TriggerContextVariables tcv){
        System.debug('Inside Method :  '+tcv);
         Triggers_Switch__c tsObj = Triggers_Switch__c.getValues('sendMailtToR1MeetingApproved');
         
         System.debug('Inside Method switch value:  '+tsObj);
        if(tsObj != null && tsObj.GE_HQ_Execute__c == true){
 System.debug('Inside First Debug : '+tsObj.GE_HQ_Execute__c + ':: and the second value : '+GEESGlobalContextController.sendMailtToR1MeetingApproved_Flag);
        if(GEESGlobalContextController.sendMailtToR1MeetingApproved_Flag == false){
             
            Map<Id,Opportunity> OldOppMap = (Map<Id,Opportunity>) tcv.oldMap; 
            List<Opportunity> NewOppList = (List<Opportunity>) tcv.newList;
            
            List<ID> approvedOppties=new List<ID>();
            Map<Id,List<String>> groupMapping=new Map<Id,List<String>>();
            List<String> groupNames;
            GEPW_PGP_PostR1Mail__c groupValues;
            
    System.debug('Inside second If  : : '+OldOppMap + ' -----  '+NewOppList);
            for(Opportunity opportunity:NewOppList)
            {
                if(opportunity.GE_OG_Install_Country__c != 'IRAN, ISLAMIC REPUBLIC OF' && opportunity.GE_PW_R1_Approval_Date__c != null  && opportunity.GE_PW_R1_Approval_Date__c != oldOppMap.get(opportunity.id).GE_PW_R1_Approval_Date__c && opportunity.recordtypeid==PGPRecIdOpp)
                {
                    System.debug('inside first if condition inside for loop');
                    groupNames=new List<String>();
                    groupValues =GEPW_PGP_PostR1Mail__c.getValues(opportunity.GE_Tier2_IRegion__c);
                    groupNames.add(groupValues.GE_PW_PGP_Proposal_Leader_Group__c);
                    groupNames.add(groupValues.GE_PW_PGP_RCAE_Group__c);
                    groupMapping.put(opportunity.id,groupNames);
                    approvedOppties.add(opportunity.id);
                }
                else if(opportunity.GE_OG_Install_Country__c == 'IRAN, ISLAMIC REPUBLIC OF' && opportunity.GE_PW_R1_Approval_Date__c != null  && opportunity.GE_PW_R1_Approval_Date__c != oldOppMap.get(opportunity.id).GE_PW_R1_Approval_Date__c && opportunity.recordtypeid==PGPRecIdOpp)
                {
                    System.debug('inside second if condition inside for loop');
                    groupNames=new List<String>();
                    groupValues =GEPW_PGP_PostR1Mail__c.getValues('IRAN, ISLAMIC REPUBLIC OF');
                    groupNames.add(groupValues.GE_PW_PGP_Proposal_Leader_Group__c);
                    groupNames.add(groupValues.GE_PW_PGP_RCAE_Group__c);
                    groupMapping.put(opportunity.id,groupNames);
                    approvedOppties.add(opportunity.id);
                }
    
            }
    System.debug('approved oppty no : '+approvedOppties);
            if(approvedOppties.size()>0)
            {
                System.debug('approved oppty no : '+approvedOppties);
            GEESGlobalContextController.sendMailtToR1MeetingApproved_Flag = true;
                GE_PGP_Send_Pre_ITO_Mails.sendEmail(approvedOppties,true,groupMapping);
            }
        }
        
     } 
     }

====================================================

And from some other class I am claaing this method : 

 //After Update Methods / Logic
    protected override void afterUpdate(GE_PW_TriggerContextVariables tcv) {
        if(af_update == false){
            GE_PW_OpportunityTrigger_LogicHandler.GEESupdating_stage_reason(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.GE_PRM_Opportunity_Sharing(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.GE_ES_Currency_PL_Mismatch(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.GE_PW_Update_Keyplayers_Info(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.UpdateFinSum(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.AddSalesTeamUpdate(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.Update_Tier_Values(tcv);  
            GE_PW_OpportunityTrigger_LogicHandler.OpportunityAmount_RecordTypeChanges(tcv);  
            GE_PW_OpportunityTrigger_LogicHandler.Update_Line_Items(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.COCurrencyUpdate(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.UpdateOpportunityScopeAndPlaform(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.UpdateSOPStatusAndSlotRequested(tcv);  
            GE_PW_OpportunityTrigger_LogicHandler.sendMailtToR1MeetingApproved(tcv); 
            GE_PW_OpportunityTrigger_LogicHandler.eRAM_EmailNotification(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.sendeMailToERAMFinance(tcv); 
            GE_PW_OpportunityTrigger_LogicHandler.AutoOpportunityCreation(tcv);
            GE_PW_OpportunityTrigger_LogicHandler.syncPBUE(tcv);
            //added for 8852
            GE_PW_OpportunityTrigger_LogicHandler.AddSalesTeamDP(tcv);
            
            //Integration class call Start
            GE_PW_IntegrationTrigger_LogicHandler.publish_EBS_Integration(tcv);
            //GE_PW_IntegrationTrigger_LogicHandler.publish_Julit_Integration(tcv);
            GE_PW_IntegrationTrigger_LogicHandler.publish_propcost_Integration(tcv);
            GE_PW_IntegrationTrigger_LogicHandler.publish_Nuclear_Integration(tcv);
            GE_PW_IntegrationTrigger_LogicHandler.publish_PMX_Integration(tcv);
            GE_PW_IntegrationTrigger_LogicHandler.publish_ChangePoint_Integration(tcv);
            //Integration class call end
            af_update = true;
        }
        

Thanks,
Rajat