You need to sign in to do that
Don't have an account?
Joaquin_tegui
Any help will be useuful!
Thanks
Assigning a Task to a Queue
Hi All,
I'm having an Issue when assigning a Task to a Queue. Right now if I crate a task in Annonymous apex with a queue ID everything works perfectly. But if I do it though a class of Inbound Email or a REST resource it fails. The error is that it does not recogni the queue ID.
Here is my code for the Email Service
global class inboundEmailTaskCreation implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, Messaging.InboundEnvelope env){ Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); String EmailBody= ''; EmailBody = email.plainTextBody; Task newTask = new Task(); try { //Getting the queue Id Group gradoQueue = [SELECT ID from Group WHERE Type = 'Queue' AND DeveloperNAME = 'Grado' ]; //Creating the task newTask = new Task(Description = myPlainText, Priority = 'Normal', Subject = 'Correo Electrónico: ' + email.subject, Status = 'Open', ActivityDate = Date.today() ); insert newTask; System.debug('New Task Object: ' + newTask ); } catch (QueryException e) { System.debug('Query Issue: ' + e); } result.success = true; return result; } }
Any help will be useuful!
Thanks