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
AbAb 

Triggers not firing while using data laoder

Hello,

I have used data loader to make make update on all the records for an object.

The field i am updating is getting updated correctly but the triggers which i used to update certain values are not working, the trigger is workig if i make update mannualy but not by data loader.

I have already checked By pass trigger check box.

What are other reasons that can halt this update ?
Best Answer chosen by Ab
Sumit Kumar Singh 9Sumit Kumar Singh 9

Helllo Sandrine, 

It seems that your trigger is not bulkified i.e trrigger is not designed/written to handle bulk data. 
Trigger would be firing, but onty for the first record in the batch.

Suppose, you have to update 1000 records. In the dataloder you have specified batch size of 200, then 1000/200 = 5 i.e the first record of the each batch would have updated. 

Hope, this will help you.


Thanks,
sumit Kuamr Singh

All Answers

Amit Chaudhary 8Amit Chaudhary 8
Please post your trigger code.
AbAb
/**
 * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs)
 **/
trigger dlrs_Custom_ObjectTrigger on Forfait_candidat__c
    (before delete, before insert, before update, after delete, after insert, after undelete, after update)
{
    dlrs.RollupService.triggerHandler();
}
 	 
/**
 * Auto Generated and Deployed by the Declarative Lookup Rollup Summaries Tool package (dlrs)
 **/
@IsTest
private class dlrs_Custom_ObjecttTest
{
    private static testmethod void testTrigger()
    {
        // Force the dlrs_Custom_ObjectTrigger to be invoked, fails the test if org config or other Apex code prevents this.
        dlrs.RollupService.testHandler(new Forfait_candidat__c());
    }
}

It is a custom trigger which updates the values.
Sumit Kumar Singh 9Sumit Kumar Singh 9

Helllo Sandrine, 

It seems that your trigger is not bulkified i.e trrigger is not designed/written to handle bulk data. 
Trigger would be firing, but onty for the first record in the batch.

Suppose, you have to update 1000 records. In the dataloder you have specified batch size of 200, then 1000/200 = 5 i.e the first record of the each batch would have updated. 

Hope, this will help you.


Thanks,
sumit Kuamr Singh

This was selected as the best answer
AbAb
What can be the solution then ?
Amit Chaudhary 8Amit Chaudhary 8
It look like  you are using manage package "dlrs.RollupService" which is not bulkfy.

If you can provide code for "dlrs.RollupService" please post. I hope this is manage package which you will not able to see
AbAb
I used batch size 1 in data loader, and it seems to be working
Sumit Kumar Singh 9Sumit Kumar Singh 9
Haha.. Okay.