New answers tagged dml
0
votes
Which is a better approach when updating records using batch class, to place it in execute or finish method?
In Salesforce batch Apex, the best practice is to perform DML operations in the execute method, not in the finish method. This is because the finish method is intended for post-processing operations, ...
2
votes
Accepted
Executing SOQL with User Mode and then DML with user Mode causing Exception
My_Rule__c appears to be a master-detail relationship field with reparenting disabled. For some reason, supplying the same value as what is already in the field still causes this error, because the ...
1
vote
Accepted
I'm trying to bulkify the update of parent field based on child
You are querying the rooms by their name instead of their database identifier.
Instead of WHERE Name IN use WHERE Id IN.
An improved version of your snippet, with an early return and a more selective ...
Top 50 recent answers are included
Related Tags
dml × 521apex × 335
trigger × 90
soql × 42
unit-test × 37
visualforce × 35
dmlexception × 35
batch × 33
exception × 27
update × 25
database × 22
callout × 18
governorlimits × 18
upsert × 15
class × 14
error × 13
insert × 13
sobject × 12
list × 11
future × 11
visual-workflow × 8
before-trigger × 8
dml-operations × 8
webservices × 7
performance × 7