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

Please help to resolve my trigger problem



In below trigger while updation of record i am checking the new expiration date and old expiration date and if they are not equal then i am updating the field Record_Support_Expiration_Date_Sub_Text1__c but what is the problem its not  working


trigger UpdateoldExpirationdateonChange on Record_Support__c (Before update) {
try {
      List<Record_Support__c updateList = new List<Record_Support__c>();
         for (Integer i = 0; i <; i++)   { 
            if ([i].Expiration_Date__c != Trigger.old[i].Expiration_Date__c) { 
                System.debug('-------old[i].Expiration_Date__c------------' +Trigger.old[i].Expiration_Date__c);
      [i].Record_Support_Expiration_Date_Sub_Text1__c=Trigger.old[i].Expiration_Date__c; //remove credit card entries prior to committing data to Salesforce
                 System.debug('-------[i].Record_Support_Expiration_Date_Sub_Text1__c------------' +[i].Record_Support_Expiration_Date_Sub_Text1__c);
     update updateList;
   } catch(Exception e) {
//      System.Debug('removeCCValue Trigger failed: '+e.getMessage()); //write error to the debug log

Thanks in advance:))))




Hi Satyam


what is the error?