• Zachary B.
  • NEWBIE
  • -3 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi Everyone,

Currently we have a custom email object, that we are trying to migrate away from. I am trying to have the class which contains status updates, and queue re-assignment actions, to only trigger if the case is a certain record type. 

The code used to trigger on (before insert, before update, before delete, after insert, after update, after delete) , however I was running into countless errors with that. 

What I currently have is below, but  it is just not running the class at all. This means it is running my workflow rule actions on every record type, instead of just the one I want on the trigger. 

trigger CompanyEmailMessageTrigger on Company_Email_Message__c (after update, after delete, after undelete)
{
ID rectypeid =
Schema.SObjectType.case.getRecordTypeInfosByName().get('Support_Request_1').getRecordTypeId();


if (rectypeID !='Support_Request_1')

{
    TriggerFactory.createAndExecuteHandler(CompanyEmailMessageTriggerHandler.class);
}
}

Hi Everyone,

Currently we have a custom email object, that we are trying to migrate away from. I am trying to have the class which contains status updates, and queue re-assignment actions, to only trigger if the case is a certain record type. 

The code used to trigger on (before insert, before update, before delete, after insert, after update, after delete) , however I was running into countless errors with that. 

What I currently have is below, but  it is just not running the class at all. This means it is running my workflow rule actions on every record type, instead of just the one I want on the trigger. 

trigger CompanyEmailMessageTrigger on Company_Email_Message__c (after update, after delete, after undelete)
{
ID rectypeid =
Schema.SObjectType.case.getRecordTypeInfosByName().get('Support_Request_1').getRecordTypeId();


if (rectypeID !='Support_Request_1')

{
    TriggerFactory.createAndExecuteHandler(CompanyEmailMessageTriggerHandler.class);
}
}