I am trying to update a list of custom object, I tried putting a System.debug on the Before Update to know if my DML really went there.

If I update only one single record it shows me the System.debug on before Update, but when I am trying to update the whole list of 10 records, even one System.debug won't show up. Only debugs on my After Update is showing, thats why my logics in Before Update won't fire. It does not give any error or such.

Here is my trigger:

trigger Custom_Object_Trigger on Custom_Object__c (after update, after insert, before update, before insert) {

                System.debug('After Update Went Here');
                Custom_Object_TriggerHandler.onAfterUpdate(Trigger.new, Trigger.oldMap);



                System.debug('Before Update Went Here');
                Custom_Object_TriggerHandler.onBeforeUpdate(Trigger.new, Trigger.oldMap);



And Here's how I execute the Update:

List<Custom_Object__c> cObj = [Select Id, Name, Field_One__c, Field_Two__c FROM Custom_Object__c];

cObj[5].Field_One__c = 'UPDATED VALUE OF ONE';
cObj[5].Field_Two__c = 'UPDATED VALUE OF TWO';

    update cObj;
}catch(Exception ex){

Custom_Object__c contains 10 records. No Exception Errors are thrown. Both Field_One__c and Field_Two__c are Text Fields.

  • Show code, how you are performing dml. Maybe exception interrupts your transaction – Oleksandr Berehovskyi Apr 18 at 9:12
  • Updated my post. – Miguel Gaurano Punzal Apr 18 at 9:17
  • try to remove try-catch block and run the code. I bet, there is an exception – Oleksandr Berehovskyi Apr 18 at 9:36
  • No luck, no error is showing up. – Miguel Gaurano Punzal Apr 18 at 9:42
  • I tried doing this update in Data Loader and setting the batch size to 1 - and my trigger seems to be working fine . But if I am going to set it back to 200 which is the Data Loader default batch size then its giving me the same problem. – Miguel Gaurano Punzal Apr 18 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.