You need to sign in to do that
Don't have an account?
Jai
Please help me on the below error
trigger
----------
trigger OpportunityUpdateFromTicket on Case (before insert,after insert,before update,after update) {
if(trigger.isAfter&&(trigger.isInsert || trigger.isUpdate))
{
OpportunityUpdateFromTicketHandler.emailNotificationFromIteroBackOffice(trigger.new,trigger.oldMap);
}
}
Helper class
------------------------
public class OpportunityUpdateFromTicketHandler {
Public static void emailNotificationFromIteroBackOffice(List<case> ticketList,Map<String,Case> oldMapCase)
{
EmailTemplate et = [SELECT Id,Subject, Body FROM EmailTemplate WHERE DeveloperName ='iTero_back_office_Template'];
Map<ID, RecordType> recordTypeMap = New Map<ID, RecordType>([Select ID, Name From RecordType Where sObjectType = 'Case']);
List<string> toAddress = new List<string>();
toAddress.add('scannerinstall@aligntech.com');
List<Messaging.SingleEmailMessage> allmsg = new List<Messaging.SingleEmailMessage>();
for(Case ticket :ticketList)
{
if(recordTypeMap.get(ticket.recordTypeID).name.containsIgnoreCase('iTero Contracts') && ticket.Ticket_Type__c =='New scanner sale' && ticket.Final_Status__c != oldMapCase.get(ticket.Id).Final_Status__c && ticket.Final_Status__c =='Processed/Assigned to Logistics' )
{
if(ticket.Region__c =='NA' || ticket.Region__c =='LATAM')
{
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTemplateId(et.Id);
mail.setToAddresses(toAddress);
mail.setSubject(et.subject);
mail.setHTMLBody(et.Body);
allmsg.add(mail);
}
}
}
Messaging.sendEmail(allmsg);
}
}
error:
----------
Method does not exist or incorrect signature: void emailNotificationFromIteroBackOffice(List<Case>, Map<Id,Case>) from the type OpportunityUpdateFromTicketHandler
Thanks!!
----------
trigger OpportunityUpdateFromTicket on Case (before insert,after insert,before update,after update) {
if(trigger.isAfter&&(trigger.isInsert || trigger.isUpdate))
{
OpportunityUpdateFromTicketHandler.emailNotificationFromIteroBackOffice(trigger.new,trigger.oldMap);
}
}
Helper class
------------------------
public class OpportunityUpdateFromTicketHandler {
Public static void emailNotificationFromIteroBackOffice(List<case> ticketList,Map<String,Case> oldMapCase)
{
EmailTemplate et = [SELECT Id,Subject, Body FROM EmailTemplate WHERE DeveloperName ='iTero_back_office_Template'];
Map<ID, RecordType> recordTypeMap = New Map<ID, RecordType>([Select ID, Name From RecordType Where sObjectType = 'Case']);
List<string> toAddress = new List<string>();
toAddress.add('scannerinstall@aligntech.com');
List<Messaging.SingleEmailMessage> allmsg = new List<Messaging.SingleEmailMessage>();
for(Case ticket :ticketList)
{
if(recordTypeMap.get(ticket.recordTypeID).name.containsIgnoreCase('iTero Contracts') && ticket.Ticket_Type__c =='New scanner sale' && ticket.Final_Status__c != oldMapCase.get(ticket.Id).Final_Status__c && ticket.Final_Status__c =='Processed/Assigned to Logistics' )
{
if(ticket.Region__c =='NA' || ticket.Region__c =='LATAM')
{
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTemplateId(et.Id);
mail.setToAddresses(toAddress);
mail.setSubject(et.subject);
mail.setHTMLBody(et.Body);
allmsg.add(mail);
}
}
}
Messaging.sendEmail(allmsg);
}
}
error:
----------
Method does not exist or incorrect signature: void emailNotificationFromIteroBackOffice(List<Case>, Map<Id,Case>) from the type OpportunityUpdateFromTicketHandler
Thanks!!
There is small error in the Method definition.
Can you please change the input parameters of the method as below.
Always Trigger.oldmap witll give map<id,Sobject> .
As you gave Map<String,Sobject> it thrown error.
Let me know if you face any error.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
There is small error in the Method definition.
Can you please change the input parameters of the method as below.
Always Trigger.oldmap witll give map<id,Sobject> .
As you gave Map<String,Sobject> it thrown error.
Let me know if you face any error.
If this solution helps, Please mark it as best answer.
Thanks,
Use this :
Public static void emailNotificationFromIteroBackOffice(List<case> ticketList,Map<Id,Case> oldMapCase)
Thanks for your help it is working know!