• rgil
  • NEWBIE
  • 0 Points
  • Member since 2013

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

I'm a complete n00b at this and am eternally grateful for any assistance.

 

The goal is to automated round robin lead assignments.  I’ve installed the Round Robin Record Assignment app which is designed for Cases, but as others have said here and elsewhere, it needs some modification to make it work for Leads.  I’ve followed the instructions to create the triggers leadOwnerUpdate and leadRoundRobin based on what was built in for Cases (I would link to the page where I got the leadRoundRobin code, but I can’t seem to find it right now – it’s basically using Lead instead of Case in these new triggers).  I also created a class called TestMethodCls4 which is based on what’s included for the package for testing Cases, but it’s saying I’ve only got 66% test coverage when I try to deploy the two new triggers and class from the Sandbox to the Enterprise account.

 

Can anyone provide any assistance as to how I should update my test class to get at least 9% more coverage?  I've been up almost the entire night working on this and researching what I could find online, so this is a last resort.  Thank you in advance!

hi,

 

i have created one Apex Trigger under Task section, that is working fine in sandbox account. when i am trying to deploy the same Trigger in to production, i am getting "Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required". i am using Eclipse for deployment.

 

my Requirement is upon clicking save buttion on new Task page, i need to fire an trigger to get last completed task comments to merge with the current comments.

 

 

Here is the my Trigger:

 

trigger Update_Comments_Task on Task (before insert) {

 

List<Id> whoIds = new List<Id>();

 

for(Task oTask : Trigger.new){

whoIds.add(oTask.WhoId);

}

 

//Get Existing Tasks

List<Task> exTask =[select Id,Description from Task where WhoId in :whoIds and status = 'Completed' Order by CreatedDate Desc];

 

for(Task oTask : Trigger.new){

if(exTask.Size() > 0){

for(Task tmpTask:exTask){

if(oTask.Description!=null && tmpTask.Description!=null){oTask.Description = tmpTask.Description +

'\n' + oTask.Description;

}

else if(oTask.Description==null && tmpTask.Description!=null){

oTask.Description = tmpTask.Description;

}

else if(oTask.Description!=null && tmpTask.Description==null){

oTask.Description = oTask.Description;

}

else{oTask.Description = '';

}

break;

}

}

 

}

}

 

 

the above Trigger is working fine in sandbox account.

Can you please help me, how can i improve my test  coverage percentage to 75%.