function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shubham SengarShubham Sengar 

trigger problem 4

To update the owner of a case based on the values selected with in a picklist and papulate the owner field with the creaded by the field data when we have seleted any field name = status..?? 
Best Answer chosen by Shubham Sengar
Shubham SengarShubham Sengar
trigger CaseTrigger on Case(before update) 
{
   for(Case c:Trigger.new)
   {
       if(c.Status == 'Priced – (Initial)' || c.Status == 'Priced – (Re-Priced)' || c.Status == 'Price File Loaded')
      {
           c.OwnerId = c.CreatedById;
       }  
   }
}