• zokito
  • NEWBIE
  • 20 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies

 

Below is my Code. Please assist me why code in red color is not covering. We have a manage pacakge to send SMS to a mobile number.  

 

The Class

public void sendSMSToSir(List<Operation__c> OperationList){
 46	          for(Operation__c srnData&colon; operationList){
 47	              if((recordTypeMap.get(srnData.RecordTypeid) == 'LLP')
 48	                 ||(recordTypeMap.get(srnData.RecordTypeid) == 'Public')
 49	                 ||(recordTypeMap.get(srnData.RecordTypeid) == 'Private')) {
 50	                  if(recordTypeMap.get(srnData.RecordTypeid) == 'LLP'){
 51	                      CompanyExtention ='LLP';
 52	                  }else if (recordTypeMap.get(srnData.RecordTypeid) == 'Public'){
 53	                      CompanyExtention ='Ltd.';       
 54	                  }else if(recordTypeMap.get(srnData.RecordTypeid) == 'Private') {
 55	                      CompanyExtention ='Pvt. Ltd.';
 56	                  }
 57	                  
 58	                  System.Debug('--- current status---'+ srnData.Current_Status__c);
 59	                  if(srnData.Current_Status__c == 'Name Appln Filed'){
 60	                      if(srnData.Service_Segment__c == 'LLP Registration'){
 61	                          System.Debug('--- SRN Details of LLP Form 1 and its msg---');
 62	                          msg ='ROC Name- '+srnData.ROC_1st_Name__c+'\r\nForm 1\r\nSRN No.- '+srnData.Form_1A_1_SRN__c+'\r\n'+srnData.Company_Name_First_Option__c+' '+ CompanyExtention+'\r\nFiling Date- '+srnData.Form_1A_1_Date__c;
 63	                          sendSMS(sirMobile,msg);
 64	                      }else if(srnData.Service_Segment__c=='Company Registration'){
 65	                          System.Debug('--- SRN Details of Form 1A Comp Registration and its msg---');
 66	                          msg ='ROC Name- '+srnData.ROC_1st_Name__c+'\r\nForm 1A \r\nSRN No.- '+srnData.Form_1A_1_SRN__c+'\r\n'+srnData.Company_Name_First_Option__c+' '+CompanyExtention+'\r\nFiling Date- '+srnData.Form_1A_1_Date__c;
 67	                          sendSMS(sirMobile,msg);
 68	                      }

 test class is entering in if and else if but not reaching to 'msg' variable and sendSMS(sirMobile, msg) of the above code

 

 Here is the trigger from where the above code is calling

 

  for(Operation__c tempOpp : trigger.new){
        System.debug('New company Name( Tin)--'+trigger.isInsert+'--(tiA)--'+trigger.isAfter+'-(tiB)--'+trigger.isBefore+'-(tiU)--'+ trigger.isUpdate+'---'+ tempOpp.New_Company_name__c+'---'+tempOpp.Form_1A_1_SRN__c+'---'+ tempOpp.Incorporation_SRN__c );
            
            if(tempOpp.Current_Status__c == 'Name Appln Filed'
                || tempOpp.Current_Status__c =='Name Resubmission'
                || tempOpp.Current_Status__c== 'Incorporation Filed'
                || tempOpp.Current_Status__c =='Incorporation Resubmission'){       
                If((trigger.isBefore
                    || trigger.isUpdate
                    || trigger.isAfter)
                    && ( trigger.oldMap.get(tempOpp.id).current_status__c != trigger.newMap.get(tempOpp.id).current_status__c)){
                    System.debug('--Current Status---'+ trigger.oldMap.get(tempOpp.id).current_status__c +'!='+ trigger.newMap.get(tempOpp.id).current_status__c) ;    
                    SRNDetails SRN = new SRNDetails(); 
                    SRN.newRecordsOfSRN(trigger.new); 
                    SRN.sendSMSToSir(trigger.new);
                }
            }
        } 

 Here is my test class

 

tempOperation.get(0).current_status__c = ' Name Appln Filed';
                tempOperation.get(0).Company_Name_First_Option__c= 'First Option';
                tempOperation.get(0).Form_1A_1_SRN__c = 'V564789321';
                tempOperation.get(0).Form_1A_1_Date__c = date.parse('04/07/2013');
                tempOperation.get(0).ROC_Name__c='Andhra Pradesh -- Andhra Pradesh';
                update tempOperation;
                
                SRNDetails SRNRecords = new SRNDetails();
                SRNRecords.newRecordsOfSRN(tempOperation);
                SRNRecords.sendSMSToSir(tempOperation);
                
                tempOperation.get(0).current_status__c = ' Name Resubmission';
                tempOperation.get(0).Company_Name_First_Option__c= 'Second Option';
                tempOperation.get(0).Form_1A_1_SRN__c = 'V564789321';
                tempOperation.get(0).Form_1A_1_Date__c = date.parse('04/07/2013');
                tempOperation.get(0).ROC_Name__c='Andhra Pradesh -- Andhra Pradesh';
                update tempOperation;
                System.Debug('---List contain UT2(1)---'+ tempOperation);
                SRNDetails SRNRecords1 = new SRNDetails();
                SRNRecords1.newRecordsOfSRN(tempOperation);
                SRNRecords1.sendSMSToSir(tempOperation);

 Please help me and thanks in anticipation.

 

Regards

 

Rohit

Hi Everyone,

when I try to install Eclipse Juno 4.2 with the force.com IDE I get the following error message:

 

Cannot complete the install because one or more required items could not be found.
  Software being installed: Force.com IDE 25.0.0.201206181021 (com.salesforce.ide.feature.feature.group 25.0.0.201206181021)
  Missing requirement: Force.com IDE 25.0.0.201206181021 (com.salesforce.ide.feature.feature.group 25.0.0.201206181021) requires 'org.eclipse.update.ui 0.0.0' but it could not be found

 Does anyone know how to fix this?

 

Kind regards,

 

Otto

  • July 02, 2012
  • Like
  • 0
I am working on white listing salesforce ip ranges so that requests from SalesForce can get through our company firewall. Got the range for PROD. What is the range for Sandboxes? Can't seem to find it anywhere. Please help.
  • January 07, 2010
  • Like
  • 0