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
Chris KamarianakisChris Kamarianakis 

Trigger on Note object not firing in production yet works fine in SB

I created a Note trigger that parses out a particular string from the title and writes it to a custom field within its parent opportunity. I have run several tests within the sandbox environment and the trigger works. When i move it to production however, the trigger does not even fire. i tried both the developer console and the eclipse environment with no luck. i tried starting from scratch and building a simple version of the trigger to make sure no errors would intervene yet the problem still exists. i even built a simular trigger yet on the attachment object and that worked. i checked to see if there are any pre existing triggers on the note object that may screw my trigger up and there arent any. i am now out of options and need asistance

simple  Note Trigger

trigger InvoiceListener on Note (after insert) {
    
  System.Debug('false: ');  

    /*    
 
   
    boolean b = MyMatcher.find();
     System.Debug('here');
    
    if(b == true){
        
    List<Opportunity> oppQuery = null;
       oppQuery = [SELECT Id, accountId FROM Opportunity WHERE Id= :pId ];
    Opportunity op =  oppQuery.get(0);
        System.Debug(op);
        //System.Debug('true: '+MyMatcher.group().substring(1));
        //DateTime d = datetime.now();
    //string timeStr = d.format('MMMMM dd, yyyy');
        //op.Invoice_Number__c = MyMatcher.group().substring(1);
        //op.Invoice_Date__c = Date.today();
         update op;

   
    }
    else{
      System.Debug('false: '+descrip );  
    }
  */
}

Simular working attachment trigger

trigger AttachmentTest on Attachment (after insert) {
String Title;
Id pId;

for(Attachment att: Trigger.new){
Title=att.Name;
pId=att.ParentId;
}



 

}
john4sfdcjohn4sfdc
try to setup a debug log and see if the Boolean value b is returning true. Your trigger would execute only if the value of b is true.

Please like if it helps you
Chris KamarianakisChris Kamarianakis
i put a system.debug outside of trigger so regardless of the boolean value, a debug message would be written. not only that, a debug message isnt even neccessary since once the debug log is enabled on a particular account, the execution of a trigger will be captured under it and thats the problem, that debug log isnt writing anything for the note trigger when i mannuelly add a new note  yet my simular attachment trigger works as indicated within a debug entry