• Justin Cairns 14
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Is there a way to write logic that can determine if a value starts with any alpha character or any numeric character?  Example would be we want to know if a string begins with an 2 alpha characters.  Or we want to know if it begins with any 3 numeric values.  Or a combination.  

@@#####  So this would indicate the string should start with any 2 alpha and then have 5 numeric.  This will be used in an APEX batch process uses a rules table to determine if records meet one of the defined criteria.  So we would need a way to define the mapping and then a way to check it in APEX.  Any help would be appreciated.  Thanks.  
I am creating a trigger that will call code to count contacts at the account level meeting certain criteria.  It's working for Adds and Updates, but when I delete a contact the trigger is not updating anything.  Here is the trigger.  Do I need to place the isDelete somewhere else so that it will use the current values instead of the values before the action?  

trigger TAFS_Contact_Trigger on Contact(after insert, after update, after delete){
    if(Trigger.isAfter){
        if(Trigger.isInsert){
            TAFS_ContactTriggerHandler.contactInsert(Trigger.new);
        }
        if(Trigger.isDelete){
            TAFS_ContactTriggerHandler.contactInsert(Trigger.old);
        }
        if(Trigger.isUpdate){
            TAFS_ContactTriggerHandler.contactInsert(Trigger.new);
        }
    }