• Kalyani
  • NEWBIE
  • 25 Points
  • Member since 2011

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

Hi, I have a situation where Leads satisfying certain criteria should go to a Holding Queue. The leads assigned to that Holding Queue Should stay for 30 mins in that Queue. The lead can be manually assigned to another user within that 30 mins span of time. If the lead is not assigned manually after 30 mins to another user then the leads should go to another 5 Queues based on some criteria. Can anyone suggest me the best way to accomplish this. Will triggers work for this scenario or should i use a apex scheduler? How can i calculate the 30 mins span of time for the leads in that queue ? 

Hi,

 

I have a custom object "Branch __c" and it has fields "Name" which is the name of a branch and "Branch User" which is a look up field for a User. On leads i have a look up to branch object to select the "branch". When a branch is selected on lead i want the lead Owner field to be changed or the lead be assigned to "Branch User" on the branch object. I am using the following trigger to update the field but i am not able to so. Can you please correct the code for me.

 

trigger Lead_UpdateOwner on Lead(before insert,before update)
{
    Map<Id, String> ownerMap = new Map<Id, String>();
    for (Lead lead : Trigger.new)
    {
        ownerMap.put(lead.OwnerId, lead.Branch__c);
    }
    
    List<String> leadBranchNames = new List<String>();
    leadBranchNames = ownerMap.values();    
     
       
   Map<String, String> branchMap = new Map<String, String>();
    
   for (Branch__c b : [select Name, Branch_MC__c from Branch__c where Name in :leadBranchNames])
    
    {
         branchMap.put(b.Name, b.Branch_MC__c);
    
    }
    
    List<String> branchMcs = new List<String>();
    branchMcs = branchMap.values();
      

    if (ownerMap.size() > 0)
    {
        for (User[] users : [SELECT Id, Name FROM User WHERE Id IN :branchMcs])
        {
            for (Integer i=0; i<users.size(); i++)
            {
                ownerMap.put(users[i].Id,null);
            }
        }
       
    }
}

 

Hi, I have a situation where Leads satisfying certain criteria should go to a Holding Queue. The leads assigned to that Holding Queue Should stay for 30 mins in that Queue. The lead can be manually assigned to another user within that 30 mins span of time. If the lead is not assigned manually after 30 mins to another user then the leads should go to another 5 Queues based on some criteria. Can anyone suggest me the best way to accomplish this. Will triggers work for this scenario or should i use a apex scheduler? How can i calculate the 30 mins span of time for the leads in that queue ? 

Hi,

 

I have a custom object "Branch __c" and it has fields "Name" which is the name of a branch and "Branch User" which is a look up field for a User. On leads i have a look up to branch object to select the "branch". When a branch is selected on lead i want the lead Owner field to be changed or the lead be assigned to "Branch User" on the branch object. I am using the following trigger to update the field but i am not able to so. Can you please correct the code for me.

 

trigger Lead_UpdateOwner on Lead(before insert,before update)
{
    Map<Id, String> ownerMap = new Map<Id, String>();
    for (Lead lead : Trigger.new)
    {
        ownerMap.put(lead.OwnerId, lead.Branch__c);
    }
    
    List<String> leadBranchNames = new List<String>();
    leadBranchNames = ownerMap.values();    
     
       
   Map<String, String> branchMap = new Map<String, String>();
    
   for (Branch__c b : [select Name, Branch_MC__c from Branch__c where Name in :leadBranchNames])
    
    {
         branchMap.put(b.Name, b.Branch_MC__c);
    
    }
    
    List<String> branchMcs = new List<String>();
    branchMcs = branchMap.values();
      

    if (ownerMap.size() > 0)
    {
        for (User[] users : [SELECT Id, Name FROM User WHERE Id IN :branchMcs])
        {
            for (Integer i=0; i<users.size(); i++)
            {
                ownerMap.put(users[i].Id,null);
            }
        }
       
    }
}