SFDC Issue in Runtime engine while bulk DML operation

Salesforce Issue in partial record processing in bulk DML operation


Here we will go through the issue related to partial record processing in bulk DML operations for example. Data loader, or database.insert( listSobject, false ).

What is partial update?

To understand the issue, first let’s understand partial update.
Suppose we try to insert 5 records into Lead object and 1 fails 4 succeeds. This is called partial records processing in bulk DMLs.

Scenario

Let’s execute a scenario and prove that there is an issue with Salesforce partial record processing .
  1. Suppose we have a trigger as shown below. This sets the email field for all the newly inserted leads.



2.       Now suppose we insert below listed leads using data loader. Since we know that Company is mandatory on lead object, So last lead ‘Lead10’ should fail and all other should be successfully inserted. Also for success full leads email id should be set to ‘testemail@domain.com’ by trigger.


3.       Now go to SFDC and check if the inserted leads are having proper values. You will find that 9 leads which inserted successfully have Email field empty.




  1.  Expected output was to have all 9 leads with email id populated by trigger.
It seems to be the issue in sfdc with its Runtime engine which handles bulk DML. 
ave a look on the previous post to identify how runtime engine works.

Comments

Popular posts from this blog

Secure Apex Code with User Mode Database Operations (Generally Available)

Use the System.enqueueJob Method to Specify a Delay in Scheduling Queueable Jobs

IsVisibleInSelfService on Task salesforce