Skip to main content
added 891 characters in body
Source Link
sumchans
  • 887
  • 2
  • 22
  • 51

I am trying to call a custom method called addColdCustomerToList from execute method, is that something that can be done inside a batch class.
global Database.QueryLocator start(Database.BatchableContext BC) {

}   
    
global void execute(Database.BatchableContext BC, List<sumchans__MDU_Squad_Raw_Data__c> rawData) {        

}
    
public void addColdCustomerToList(String fullAddress, String suiteNumber, String givenName, String surname,String telephoneNumber, String internetOffering, String videoOffering, String phoneOffering) {        
    sumchans__Address_ColdCustomers__c coldCustomer = new sumchans__Address_ColdCustomers__c(); // Tracking cold customers of this address.
    coldCustomer.Name = fullAddress;
}
   
global void finish(Database.BatchableContext BC) {
    
}

After the edits: I am getting these 2 errors when saving this code

1. Method does not exist or incorrect signature: void addColdCustomerToList(String, String, String, String) from the type sumchans.MDUSquadAddressDataSummarizer

2. Invalid constructor name: addColdCustomerToList

    global Database.QueryLocator start(Database.BatchableContext BC) {
      return Database.getQueryLocator('SELECT sumchans__Street_Address__c,sumchans__City_Name__c FROM sumchans__MDU_Squad_Raw_Data__c');
}
global void execute(Database.BatchableContext BC, List<sumchans__MDU_Squad_Raw_Data__c> rawData) {        
     addColdCustomerToList(fullAddress,rawStats.sumchans__SUITE_NUM__c,rawStats.sumchans__GIVEN_NAME__c,rawStats.sumchans__SURNAME__c);           
}
public addColdCustomerToList(String fullAddress, String suiteNumber, String givenName, String surname) {        
     sumchans__Address_ColdCustomers__c coldCustomer = new sumchans__Address_ColdCustomers__c();
     coldCustomer.Name = fullAddress;
     coldCustomer.sumchans__ADDRESS_MASTER_EXT_ID__r = new sumchans__Address_Master__c(sumchans__Full_Address_Ext_Id__c = fullAddress);
     coldCustomer.sumchans__Suite_Number__c = suiteNumber;
     coldCustomer.sumchans__Full_Name__c = (((givenName).toLowerCase()).capitalize()) +' '+ (((surname).toLowerCase()).capitalize());
     addressColdCustomers.add(coldCustomer); 
}

Thank you all for the continued support.

I am getting these 2 errors when saving this code

1. Method does not exist or incorrect signature: void addColdCustomerToList(String, String, String, String) from the type sumchans.MDUSquadAddressDataSummarizer

2. Invalid constructor name: addColdCustomerToList

    global Database.QueryLocator start(Database.BatchableContext BC) {
      return Database.getQueryLocator('SELECT sumchans__Street_Address__c,sumchans__City_Name__c FROM sumchans__MDU_Squad_Raw_Data__c');
}
global void execute(Database.BatchableContext BC, List<sumchans__MDU_Squad_Raw_Data__c> rawData) {        
     addColdCustomerToList(fullAddress,rawStats.sumchans__SUITE_NUM__c,rawStats.sumchans__GIVEN_NAME__c,rawStats.sumchans__SURNAME__c);           
}
public addColdCustomerToList(String fullAddress, String suiteNumber, String givenName, String surname) {        
     sumchans__Address_ColdCustomers__c coldCustomer = new sumchans__Address_ColdCustomers__c();
     coldCustomer.Name = fullAddress;
     coldCustomer.sumchans__ADDRESS_MASTER_EXT_ID__r = new sumchans__Address_Master__c(sumchans__Full_Address_Ext_Id__c = fullAddress);
     coldCustomer.sumchans__Suite_Number__c = suiteNumber;
     coldCustomer.sumchans__Full_Name__c = (((givenName).toLowerCase()).capitalize()) +' '+ (((surname).toLowerCase()).capitalize());
     addressColdCustomers.add(coldCustomer); 
}

Thank you all for the continued support.

I am trying to call a custom method called addColdCustomerToList from execute method, is that something that can be done inside a batch class.
global Database.QueryLocator start(Database.BatchableContext BC) {

}   
    
global void execute(Database.BatchableContext BC, List<sumchans__MDU_Squad_Raw_Data__c> rawData) {        

}
    
public void addColdCustomerToList(String fullAddress, String suiteNumber, String givenName, String surname,String telephoneNumber, String internetOffering, String videoOffering, String phoneOffering) {        
    sumchans__Address_ColdCustomers__c coldCustomer = new sumchans__Address_ColdCustomers__c(); // Tracking cold customers of this address.
    coldCustomer.Name = fullAddress;
}
   
global void finish(Database.BatchableContext BC) {
    
}

After the edits: I am getting these 2 errors when saving this code

1. Method does not exist or incorrect signature: void addColdCustomerToList(String, String, String, String) from the type sumchans.MDUSquadAddressDataSummarizer

2. Invalid constructor name: addColdCustomerToList

    global Database.QueryLocator start(Database.BatchableContext BC) {
      return Database.getQueryLocator('SELECT sumchans__Street_Address__c,sumchans__City_Name__c FROM sumchans__MDU_Squad_Raw_Data__c');
}
global void execute(Database.BatchableContext BC, List<sumchans__MDU_Squad_Raw_Data__c> rawData) {        
     addColdCustomerToList(fullAddress,rawStats.sumchans__SUITE_NUM__c,rawStats.sumchans__GIVEN_NAME__c,rawStats.sumchans__SURNAME__c);           
}
public addColdCustomerToList(String fullAddress, String suiteNumber, String givenName, String surname) {        
     sumchans__Address_ColdCustomers__c coldCustomer = new sumchans__Address_ColdCustomers__c();
     coldCustomer.Name = fullAddress;
     coldCustomer.sumchans__ADDRESS_MASTER_EXT_ID__r = new sumchans__Address_Master__c(sumchans__Full_Address_Ext_Id__c = fullAddress);
     coldCustomer.sumchans__Suite_Number__c = suiteNumber;
     coldCustomer.sumchans__Full_Name__c = (((givenName).toLowerCase()).capitalize()) +' '+ (((surname).toLowerCase()).capitalize());
     addressColdCustomers.add(coldCustomer); 
}

Thank you all for the continued support.

Edited for extra help
Source Link
sumchans
  • 887
  • 2
  • 22
  • 51

Can I create a custom method and make class to it inside an Apex batch class on top of the other mandatory methods. The belowam getting these 2 errors when saving this code has a custom method named addColdCustomerToList and I want to make calls to it from the execute method, how can that be done.

1. Method does not exist or incorrect signature: void addColdCustomerToList(String, String, String, String) from the type sumchans.MDUSquadAddressDataSummarizer

2. Invalid constructor name: addColdCustomerToList

global class DataSummarizer implements Database.Batchable<sObject>, Database.Stateful {  

// Start Method
global Database.QueryLocator start(Database.BatchableContext BC) {
 
}   

// Execute method return Database.getQueryLocator('SELECT sumchans__Street_Address__c,sumchans__City_Name__c FROM sumchans__MDU_Squad_Raw_Data__c');
}
global void execute(Database.BatchableContext BC, List<sumchans__MDU_Squad_Raw_Data__c> rawData) {        
     addColdCustomerToList(fullAddress,rawStats.sumchans__SUITE_NUM__c,rawStats.sumchans__GIVEN_NAME__c,rawStats.sumchans__SURNAME__c);           
} 
public addColdCustomerToList(String fullAddress, String suiteNumber, String givenName, String surname) {
         
}     sumchans__Address_ColdCustomers__c coldCustomer = new sumchans__Address_ColdCustomers__c();
// Finish Method   coldCustomer.Name = fullAddress;
global void finish(Database   coldCustomer.BatchableContextsumchans__ADDRESS_MASTER_EXT_ID__r BC= new sumchans__Address_Master__c(sumchans__Full_Address_Ext_Id__c = fullAddress);
 {    coldCustomer.sumchans__Suite_Number__c = suiteNumber;
     coldCustomer.sumchans__Full_Name__c = (((givenName).toLowerCase()).capitalize()) +' '+ (((surname).toLowerCase()).capitalize());
}     addressColdCustomers.add(coldCustomer); 
}

Thank you all for the continued support.

Can I create a custom method and make class to it inside an Apex batch class on top of the other mandatory methods. The below code has a custom method named addColdCustomerToList and I want to make calls to it from the execute method, how can that be done.

global class DataSummarizer implements Database.Batchable<sObject>, Database.Stateful {  

// Start Method
global Database.QueryLocator start(Database.BatchableContext BC) {
 
}   

// Execute method
global void execute(Database.BatchableContext BC) {        

} 
public addColdCustomerToList(String fullAddress) {
 
} 
// Finish Method    
global void finish(Database.BatchableContext BC) {

} 
}

Thank you all for the continued support.

I am getting these 2 errors when saving this code

1. Method does not exist or incorrect signature: void addColdCustomerToList(String, String, String, String) from the type sumchans.MDUSquadAddressDataSummarizer

2. Invalid constructor name: addColdCustomerToList

    global Database.QueryLocator start(Database.BatchableContext BC) {
      return Database.getQueryLocator('SELECT sumchans__Street_Address__c,sumchans__City_Name__c FROM sumchans__MDU_Squad_Raw_Data__c');
}
global void execute(Database.BatchableContext BC, List<sumchans__MDU_Squad_Raw_Data__c> rawData) {        
     addColdCustomerToList(fullAddress,rawStats.sumchans__SUITE_NUM__c,rawStats.sumchans__GIVEN_NAME__c,rawStats.sumchans__SURNAME__c);           
}
public addColdCustomerToList(String fullAddress, String suiteNumber, String givenName, String surname) {        
     sumchans__Address_ColdCustomers__c coldCustomer = new sumchans__Address_ColdCustomers__c();
     coldCustomer.Name = fullAddress;
     coldCustomer.sumchans__ADDRESS_MASTER_EXT_ID__r = new sumchans__Address_Master__c(sumchans__Full_Address_Ext_Id__c = fullAddress);
     coldCustomer.sumchans__Suite_Number__c = suiteNumber;
     coldCustomer.sumchans__Full_Name__c = (((givenName).toLowerCase()).capitalize()) +' '+ (((surname).toLowerCase()).capitalize());
     addressColdCustomers.add(coldCustomer); 
}

Thank you all for the continued support.

added 4 characters in body
Source Link
Sebastian Kessel
  • 13.2k
  • 12
  • 38
  • 61

Can I create a custom method and make class to it inside an Apex batch class on top of the other mandatory methods. The below code has a custom method named addColdCustomerToList and I want to make calls to it from the execute method, how can that be done.

global class DataSummarizer implements Database.Batchable<sObject>, Database.Stateful {  

// Start Method
global Database.QueryLocator start(Database.BatchableContext BC) {

}   

// Execute method
global void execute(Database.BatchableContext BC) {        

} 
public addColdCustomerToList(String fullAddress) {

} 
// Finish Method    
global void finish(Database.BatchableContext BC) {

} 
}

}

Thank you all for the continued support.

Can I create a custom method and make class to it inside an Apex batch class on top of the other mandatory methods. The below code has a custom method named addColdCustomerToList and I want to make calls to it from the execute method, how can that be done.

global class DataSummarizer implements Database.Batchable<sObject>, Database.Stateful {  

// Start Method
global Database.QueryLocator start(Database.BatchableContext BC) {

}   

// Execute method
global void execute(Database.BatchableContext BC) {        

} 
public addColdCustomerToList(String fullAddress) {

} 
// Finish Method    
global void finish(Database.BatchableContext BC) {

} 

}

Thank you all for the continued support.

Can I create a custom method and make class to it inside an Apex batch class on top of the other mandatory methods. The below code has a custom method named addColdCustomerToList and I want to make calls to it from the execute method, how can that be done.

global class DataSummarizer implements Database.Batchable<sObject>, Database.Stateful {  

// Start Method
global Database.QueryLocator start(Database.BatchableContext BC) {

}   

// Execute method
global void execute(Database.BatchableContext BC) {        

} 
public addColdCustomerToList(String fullAddress) {

} 
// Finish Method    
global void finish(Database.BatchableContext BC) {

} 
}

Thank you all for the continued support.

Source Link
sumchans
  • 887
  • 2
  • 22
  • 51
Loading