1 resposta
"An Apex transaction represents a set of operations that are executed as a single unit. All DML operations in a transaction either complete successfully, or if an error occurs in one operation, the entire transaction is rolled back and no data is committed to the database. The boundary of a transaction can be a trigger, a class method, an anonymous block of code, a Visualforce page, or a custom Web service method."
Please read this link, it will help.https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_transaction.htmIn order to bulkify your code and process mutiple records in one transaction you should use apex collections E.g Maps, Set, Listhttps://developer.salesforce.com/page/Best_Practice%3A_Bulkify_Your_CodeThanks,
Fahad Akhtar