• Manish Chandra
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,
I tried to insert queue CaseOwner whenever Case is created.But it was failing to update. Even I tried to hardcode but its not working to me.
Please help me to assign.
trigger testChangeOwnerTrigger on Case (before insert) 
{
 //List<QueueSobject> queueuser = [SELECT Id,queue.Name, QueueId FROM QueueSobject WHERE SobjectType = 'Case' and queue.Name = 'Unassigned' limit 1];
     for(Case newCase : Trigger.New) 
     { 
         newCase.OwnerId ='00G90000001hkVN'; 
     }
     
}