• mark TM
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi ,

 

Please help me to write a test class for the below batch class written,

 

global class logdeletion implements Database.Batchable<sObject>{
    public String query{get;set;}
    public String email{get;set;}
    //public Id toUserId{get;set;}
   // public Id fromUserId{get;set;}
    
    global Database.querylocator start(Database.BatchableContext BC){
        return Database.getQueryLocator('Select Comments__c,Name,Owner,CreatedBy,LastModifiedBy,Date_TimeStamp__c,isSuccess__c,Report_URL__c,Result_String__c,Sample_Id__c,Sample_Stage__c FROM Log__c' );
    }
    
    global void execute(Database.BatchableContext BC, List<sObject> scope){
        List<Log__c> Logs = new List<Log__c>();
        
        for(sObject s : scope){
            Log__c a = (Log__c)s;
            
        }        
        delete Logs ;   
        //system.debug('batch apex called'+accns);     
    }
    global void finish(Database.BatchableContext BC){
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        mail.setToAddresses(new String[] {email});
        mail.setReplyTo('test@test.com');
        //mail.setSenderDisplayName('SFDC Developer Organization');
        //mail.setSubject('Batch Process');
        //mail.setPlainTextBody('Batch Process has completed');
        
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }

 

 


}Thanks

Hi ,

 

Please help me to write a test class for the below batch class written,

 

global class logdeletion implements Database.Batchable<sObject>{
    public String query{get;set;}
    public String email{get;set;}
    //public Id toUserId{get;set;}
   // public Id fromUserId{get;set;}
    
    global Database.querylocator start(Database.BatchableContext BC){
        return Database.getQueryLocator('Select Comments__c,Name,Owner,CreatedBy,LastModifiedBy,Date_TimeStamp__c,isSuccess__c,Report_URL__c,Result_String__c,Sample_Id__c,Sample_Stage__c FROM Log__c' );
    }
    
    global void execute(Database.BatchableContext BC, List<sObject> scope){
        List<Log__c> Logs = new List<Log__c>();
        
        for(sObject s : scope){
            Log__c a = (Log__c)s;
            
        }        
        delete Logs ;   
        //system.debug('batch apex called'+accns);     
    }
    global void finish(Database.BatchableContext BC){
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        mail.setToAddresses(new String[] {email});
        mail.setReplyTo('test@test.com');
        //mail.setSenderDisplayName('SFDC Developer Organization');
        //mail.setSubject('Batch Process');
        //mail.setPlainTextBody('Batch Process has completed');
        
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }

 

 


}Thanks

Hi

 

 

I want to write a trigger for giving permissions only to 2 users based on the record type and channel in account , Please guide me how to do this.

 

 

Thanks

Hi ,

 

 I have a button in case object called "Email to customer" which will automatically send an email to all customers , but i am having issues that emails are not getting delivered appropriatrely, Below is my java script,

 

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
{!REQUIRESCRIPT("/support/console/26.0/integration.js")}


var url = '/_ui/core/email/author/EmailAuthor?p2_lkid={!Case.ContactId}&p2={!Case.Contact}&rtype={!$ObjectType.Contact}&p3_lkid={!Case.Id}&&p3={!Case.CaseNumber}&retURL=%2F{!Case.Id}&p26=customercare.test@wisdompanel.com&template_id=00Xe0000000IIvA&p6=';

if(sforce.console.isInConsole() == true) { //create a sub tab when accessing the case from console
//First find the ID of the primary tab to put the new subtab in
sforce.console.getEnclosingPrimaryTabId(openSubtab);
}
else
window.open(url); // redirect to the send email screen

function openSubtab(result) {
sforce.console.openSubtab(result.id,url,true);
}

 

Please help me on this regard.

 

Thanks in Advance

 

Hi ,

 

Below is my requirement , can that be achieved via Permision set ?

 

Advance would like to remove edit permission for all advance users. Only users who should be able to edit Advance clinics should be Advance API user and Zachary.
Analyze and let me know what need to be done, as you know if we remove edit permission it will also remove permission for Account it will will not allow editing PO (person account)so need some other solution.

 

Thanks

Hi,

 

 Please help me to write a trigger for my requirement below,

 

I am creating a date field in my org which should automatically copy all the account created date to that date field.

 

Note :

 

Only the date should be copied and not the time which should happen for all ther exisiting records and new one.

 

Please kindly help me.

 

Thnks

 

Hi ,

 

Below is my requirement , can that be achieved via Permision set ?

 

Advance would like to remove edit permission for all advance users. Only users who should be able to edit Advance clinics should be Advance API user and Zachary.
Analyze and let me know what need to be done, as you know if we remove edit permission it will also remove permission for Account it will will not allow editing PO (person account)so need some other solution.

 

Thanks

Hi ,

 

Please help me to write a test class for the below batch class written,

 

global class logdeletion implements Database.Batchable<sObject>{
    public String query{get;set;}
    public String email{get;set;}
    //public Id toUserId{get;set;}
   // public Id fromUserId{get;set;}
    
    global Database.querylocator start(Database.BatchableContext BC){
        return Database.getQueryLocator('Select Comments__c,Name,Owner,CreatedBy,LastModifiedBy,Date_TimeStamp__c,isSuccess__c,Report_URL__c,Result_String__c,Sample_Id__c,Sample_Stage__c FROM Log__c' );
    }
    
    global void execute(Database.BatchableContext BC, List<sObject> scope){
        List<Log__c> Logs = new List<Log__c>();
        
        for(sObject s : scope){
            Log__c a = (Log__c)s;
            
        }        
        delete Logs ;   
        //system.debug('batch apex called'+accns);     
    }
    global void finish(Database.BatchableContext BC){
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        mail.setToAddresses(new String[] {email});
        mail.setReplyTo('test@test.com');
        //mail.setSenderDisplayName('SFDC Developer Organization');
        //mail.setSubject('Batch Process');
        //mail.setPlainTextBody('Batch Process has completed');
        
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }

 

 


}Thanks

Hi ,

 

Please help me to write a test class for the below batch class written,

 

global class logdeletion implements Database.Batchable<sObject>{
    public String query{get;set;}
    public String email{get;set;}
    //public Id toUserId{get;set;}
   // public Id fromUserId{get;set;}
    
    global Database.querylocator start(Database.BatchableContext BC){
        return Database.getQueryLocator('Select Comments__c,Name,Owner,CreatedBy,LastModifiedBy,Date_TimeStamp__c,isSuccess__c,Report_URL__c,Result_String__c,Sample_Id__c,Sample_Stage__c FROM Log__c' );
    }
    
    global void execute(Database.BatchableContext BC, List<sObject> scope){
        List<Log__c> Logs = new List<Log__c>();
        
        for(sObject s : scope){
            Log__c a = (Log__c)s;
            
        }        
        delete Logs ;   
        //system.debug('batch apex called'+accns);     
    }
    global void finish(Database.BatchableContext BC){
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        mail.setToAddresses(new String[] {email});
        mail.setReplyTo('test@test.com');
        //mail.setSenderDisplayName('SFDC Developer Organization');
        //mail.setSubject('Batch Process');
        //mail.setPlainTextBody('Batch Process has completed');
        
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }

 

 


}Thanks

Hi,

 

 Please help me to write a trigger for my requirement below,

 

I am creating a date field in my org which should automatically copy all the account created date to that date field.

 

Note :

 

Only the date should be copied and not the time which should happen for all ther exisiting records and new one.

 

Please kindly help me.

 

Thnks