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
Gaurav GulanjkarGaurav Gulanjkar 

Cannot send an email if case is still in a queue

I want to restrict an email to be sent when case is still in queue. I have a trigger on email message object. Is there any way to restrict a user. 
Also i have to disable the send Email button on the service console.
Best Answer chosen by Gaurav Gulanjkar
PratikPratik (Salesforce Developers) 
Hi Gaurav,

Here is an idea: If you can write an email on Emailmessages and case owner is queue,  add the error message.

Eg.
http://salesforce.stackexchange.com/questions/16795/trigger-on-case-emailmessage

Thanks,
Pratik
 

All Answers

PratikPratik (Salesforce Developers) 
Hi Gaurav,

Here is an idea: If you can write an email on Emailmessages and case owner is queue,  add the error message.

Eg.
http://salesforce.stackexchange.com/questions/16795/trigger-on-case-emailmessage

Thanks,
Pratik
 
This was selected as the best answer
Gaurav GulanjkarGaurav Gulanjkar
Hi Pratik,

It worked, but is it posssible to costomize the place of the error message.I do not want the error message on to of the page.

Thanks,
Gaurav
PratikPratik (Salesforce Developers) 
Glad it helped!

Thanks,
Pratik