I'm declarative developer trying to make this work: I am trying to update the case owner to a queuename based on status. Here is my code and the error I'm getting below. Any help would be appreciated!
trigger CRME_Case_ReOpen_OOO on Case (before update) {
for(case c :trigger.new){
if(c.OwnerOOO__c == TRUE && c.Status == 'Working' )
c.OwnerID = [select Id from User where Name = :c.QueueNameRef__c].Id;
}
}
Error:Apex trigger CRME_Case_ReOpen_OOO caused an unexpected exception, contact your administrator: CRME_Case_ReOpen_OOO: execution of BeforeUpdate caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.CRME_Case_ReOpen_OOO: line 14, column 1