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
Andrew Zhong 7Andrew Zhong 7 

How to prevent multiple total amount of each Fee record when using data loader with size 200?

I have a trigger with insert fee(after insert) to application. The trigger will implement adding each fee amount and then add to each application.
Like fee1: amount $400 add to Application1
       fee2: amount $400 add to Application2
       ......
       fee500: amount $400  add to Application500

I use data loader with input csv file which contains 500 fees and lookup to those application ids. (500 application ids)
Set batch size to 200.

The expected result is for each application amount should be $400. However,
the actual result is  $80,000 for each application. (batch size 20 * $400 = 80,000)

If setting the batch size is 20, the actual result is $8,000 for each application. (batch size 20 * $400 = 8,000)

Does anyone tell me how to solve this problem?








The expected result in 
Brian FordBrian Ford
Can you add your code to make the question a little clearer?