Questions tagged [transaction]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
18 views

How is transaction defined and how is Governor limit applied in Salesforce SDK?

I am creating an app with iOS using Salesforce SDK. How is transaction defined, and how is governor limit applied in this context? For example, I have an a.swift file where I am throwing API requests ...
user avatar
1 vote
0 answers
18 views

Mechanics of Select for update in Soql [closed]

I am curious how select for update is internally implemented in Salesforce? Is the locking done in the application layer or is it propagated to the DB layer? I know that Salesforce supports multiple ...
user avatar
  • 111
0 votes
3 answers
272 views

Best pratice for using static variables

I have seen classes having 100s of static variables defined. They are their for different purposes and I don't think, mostly are used in single transaction. They are used in different transactions. ...
user avatar
0 votes
1 answer
290 views

Is subflow called from flow is part of same transaction?

I have a sub-flow that is to be called from flow, Just want to know will the sub-flow be considered to be part of the same transaction as that of flow?
user avatar
1 vote
2 answers
279 views

Publish a Platform Event From Within a Platform Event Apex Trigger - Question

My scenario is the following: an Opportunity is updated for some updates, the Opportunity before update trigger needs to update one or more OpportunityLineItems. The before update trigger cannot do ...
user avatar
  • 163
0 votes
0 answers
45 views

does a second job in chain jobs sequence sees database changes done in the first job?

I am running sequence of chains jobs. Each job runs a flow who update a record. The next jobs uses the previous job db change. From some reason the next job does not see this update. why? here is the ...
user avatar
  • 38
0 votes
1 answer
41 views

Is there a way to interact with other records in the same transaction using record triggered flow?

I need to access to all the records that are in the same transaction using a record triggered flow as you can do with triggers using Trigger.New() that returns you all the record in the same ...
user avatar
  • 121
0 votes
1 answer
134 views

Multiple users and concurrent transactions

I have a client who wants us to build a custom auto-number function that applies only to a certain type of campaign record. They want to append the number to a text field for that specific campaign ...
user avatar
  • 6,418
-2 votes
1 answer
55 views

How Apex transactions work?

Part 1: We have a webpage without login(no session). On the webpage is a submit button when clicked creates a lead. It is integrated using heroku connect. When a user clicks submit a lead then a ...
user avatar
  • 101
1 vote
1 answer
735 views

How to Use Trigger Bypass Logic with Lightning Web Components?

Most Trigger frameworks come with trigger bypass functionality that allow you to selectively bypass triggers or trigger contexts for certain operations. For example, say you have CustomObject__c with ...
user avatar
0 votes
1 answer
348 views

Logging Apex exceptions through Event Bus while still rolling back the entire transaction?

I'm working on implementing a robust error logging framework for our org using Platform Events to ensure that we always capture errors in our code even if the transaction is rolled back. If I use ...
user avatar
0 votes
1 answer
270 views

How does Salesforce ensure new record IDs for the same object are unique during simultaneous inserts?

Just curious. I know record Ids are not guaranteed to be sequential from the docs. I've also already read this post on what are IDs are composed of. But lets say 2 or more transactions started at the ...
user avatar
  • 13
1 vote
0 answers
73 views

How to properly notify the data service of all modifications when imperative apex method is called from LWC

Per the documentation Refresh the Cache When Calling a Method Imperatively we need to notify the lightning data service that we used an imperative apex method to modify some records in order for it to ...
user avatar
  • 406
1 vote
1 answer
601 views

What is the Difference bw the Maximum CPU time on the Salesforce servers(10 second) and maximum execution time for each apex transaction (10 minute) [duplicate]

What is the Difference between the Maximum CPU time on the Salesforce servers(10 second) and maximum execution time for each apex transaction (10 minute) ?
user avatar
1 vote
1 answer
205 views

Marketing Cloud Txn API | Whitelist my Webhook only for Marketing Cloud calls

If I implement a webhook, it basically allows anyone to call that endpoint. As this would be a public URL. From security point of view, I should only consume event notifications coming only from ...
user avatar
  • 2,243
0 votes
1 answer
62 views

How to check the user logged in - from direct login or using api access or using Oauth? If so can I block that user accessing certain objects?

How to check the user logged in - from direct login or using api access or using Oauth? If so can I block that user accessing certain objects? Can I check the above using AuthSession object's ...
user avatar
  • 61
0 votes
2 answers
624 views

Database.rollback() Method Not Working In Different Transaction?

I have created a very simple scenario where I'm creating a savepoint and trying to rolling back in future method. The behaviour is little confusing - I tried searching it over the net but I didn't ...
user avatar
2 votes
1 answer
343 views

Salesforce Relational Database ACID

I was reading about relational databases and found that Salesforce is built on Oracle's Relational Database. Based on my understanding, Relational Databases "promise" the following ACID principle: ...
user avatar
  • 43
2 votes
0 answers
60 views

Why do we create a send definition in Marketing Cloud Transactional Email and then send it in second step

Why do we create a send definition in Marketing Cloud Transactional Email? In the steps of creating Transactional Email using Marketing Cloud API, it is given that first, create the Transactional ...
user avatar
3 votes
1 answer
126 views

Transaction Security is not available in Scratch Org

How am I able to turn on the visibility for transaction security? I am trying to test an apex class that implements TxnSecurity.PolicyCondition and according to this article to be able to see these ...
user avatar
  • 3,183
0 votes
1 answer
104 views

Apex page failing DML transaction

Let's have a very simple apex page: <apex:page controller="EventInsert" > <apex:form> <p>Event insertion test</p> <p>{!processParams}</p> <apex:...
user avatar
  • 103
2 votes
4 answers
4k views

Maximum number of records a trigger processes in a single batch?

What is the maximum number of records a trigger needs to be able to process in a single transaction/batch? Is it limited to 200? or do triggers need to be able to handle more?
user avatar
  • 8,380
0 votes
0 answers
252 views

Performing multiple operations on same record in same transaction [duplicate]

I am trying to do three operation using same record. First Operation: Set ContentDocument isArchived field to false. Second Operation: Grab contentdocument by calling REST API Endpoint. Third ...
user avatar
  • 355
0 votes
1 answer
430 views

What is the transaction boundary in apex and how the debug log files generated?

In Apex Developer Guide, I found An Apex transaction represents a set of operations that are executed as a single unit. My question is, how can I define the set of operations ? That is, If I ...
user avatar
1 vote
1 answer
438 views

Uncommited work exception in Queuable with Callback and Rollback

Is there a way to do all that Do Callout in Queueable Do Dml based on the Callout result Catch errors in 1 and 2. Rollback 1, 2 on error Report error via email and log in Custom object without ...
user avatar
8 votes
2 answers
1k views

Do Apex Transaction have a unique Id (like Batch Ids)?

I am working on a Platform Event based Logging Framework (based on the ideas of Andrew Fawcett's Dreamforce session). I want to visually group Log entries of the same transaction or batch. Batch ...
user avatar
1 vote
1 answer
922 views

Difference between Batch, Job and Transaction in Salesforce?

As a title, can anyone help me to distinguish what is the difference between Batch, Job and Transaction in Salesforce?
user avatar
2 votes
1 answer
184 views

Transaction security policy for multiple logins

I need to modify the existing transaction security policy to trigger if user logs in from multiple IP addresses in past 8 hours. I'm using the below SFDC example policy. Can someone give a hand on how ...
user avatar
0 votes
1 answer
247 views

Bulk flow interviews not interacting with one another

My goal is to run a flow in bulk and not create duplicates. First thing that happens is I lookup colCustomObject. The first interview loops through colCustomObject, determines that a new record needs ...
user avatar
  • 1,119
2 votes
2 answers
670 views

method @future two transactions

In an @future method can I persist a data at the beginning of the execution and the others at the end? Pratically, can i open and close two different transactions in the same @future method?
user avatar
1 vote
1 answer
2k views

Is a single APEX test case considered a transaction?

I'm getting DML errors when trying to test some triggers: This error occurred: MIXED_DML_OPERATION: DML operation on setup object is not permitted after you have updated a non-setup object (or ...
user avatar
  • 101
2 votes
1 answer
356 views

Confused with transaction terminology related to Visual flow limits

I am going through Apex Governor Limits that Affect Flows documentation and came across two new terms "larger transaction" and "batch transaction". I thought we only have Synchronous transaction, ...
user avatar
  • 8,392
3 votes
1 answer
2k views

Explain: Big objects don’t support transactions including both big objects, standard object and custom objects

While reading the Big Object related documentation, I was curious as to what does the following statement mean? Big objects don’t support transactions including both big objects, standard object ...
user avatar
  • 67
0 votes
0 answers
65 views

When are history records created

Two types of transactions work on a set of records. First type selects records that don't have a flag set and sets it. The second transaction selects those records that have a flag set and removes the ...
user avatar
  • 3,615
3 votes
2 answers
689 views

Does Apex transaction control have a context or scope?

Is Apex transaction control equivalent to .Net transaction scope where it only rolls back the transaction within scope? Will it rollback all the records that has been inserted between Database....
user avatar
  • 315
2 votes
2 answers
3k views

How to get and rethrow Exception from Database.insert(list, false)

I am inserting record using the allOrNothing = false option to only rollback the transaction when a certain type of error occurs (Goal: Allow the insert of Custom Records even if some of them fail as ...
user avatar
9 votes
2 answers
1k views

Aura transaction details

I have a fundamental question about Lightning technical design. Today viewing debug logs I noticed that if Lightning component make multiple calls to server-side (invoke multiple apex-controller ...
user avatar
9 votes
1 answer
1k views

How does Lightning Component Framework request boxcar'ing affect flows and transactions?

If the lightning component framework batches together multiple update requests, are they all subject to the rules and limits of a single transaction? From Queueing of Server Side Actions: The ...
user avatar
1 vote
2 answers
2k views

Remembering data between before trigger and after trigger

I want a before update trigger to remember which of the objects need something done in the after trigger handler. I tried this but I get a null reference: public class OpportunityTriggerHandler { ... ...
user avatar
  • 213
0 votes
1 answer
50 views

How triggers start firing?

Is it guaranteed that when we create/update/delete two different records separately but in one time and from one user create/update/delete trigger fires twice? Or two these operation can be merged in ...
user avatar
3 votes
1 answer
959 views

Trigger.new List During a Transaction

This is a question I have always wondered. I have a series of classes and methods that modify the Trigger.new case list records as the list is handed off to each class and method. Apex goes down the ...
user avatar
0 votes
0 answers
20 views

Time-based workflows and triggered transactions [duplicate]

Say that there is a time based workflow on creation which updates something after 1 day. Two records are created via two different API calls (say we exposed a REST service), these two different calls ...
user avatar
  • 727
4 votes
2 answers
289 views

Rollback Block?

I am curious what kind of syntax is Apex method System.runAs(){ } where in curly brackets I can run my code which will be executed as passed user. I would like to write my own method with that syntax ...
user avatar
  • 604
0 votes
1 answer
250 views

Question about apex transaction

According to the documentation: 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 ...
user avatar
  • 355
2 votes
1 answer
199 views

Salesforce transaction mutexes

This is more of a theory question. We have a use case where an object field is the sum of the records existing in the system + 1. This method is going to be accessed via force remoting. My worry is ...
user avatar
  • 2,615
2 votes
1 answer
837 views

Does Database.rollback work when encountering a Salesforce Limit Error

I am doing some testing on Salesforce Transaction controls and noticed something odd. I was wondering if I am missing something or if I am just not following 'best practices'. System.Savepoint sp = ...
user avatar
7 votes
1 answer
387 views

Is an AsyncApexJob record inserted immediately at the end of a transaction?

Is an AsyncApexJob record inserted immediately at the end of a transaction or is it possible that there is a delay between those two events? I couldn't find firm guarantee in the documentation on that....
user avatar
  • 3,615
0 votes
1 answer
630 views

Database Class and DML in a transaction

According to the official document - https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_transaction.htm I understand that if there is any error in a transaction ...
user avatar
  • 4,591
1 vote
1 answer
186 views

Mixed DML Operations in Test Methods - system.RunAs(user) - but why?

Reading the documentation here, the advice is to run certain DML operations within a System.runAs(user) block. I don't really understand why that needs to happen. I know that it works - as my unit ...
user avatar
11 votes
1 answer
2k views

When is a FOR UPDATE lock released?

The Salesforce docs say that The lock gets released when the transaction completes Does that mean when the record is updated, or when the execution context completes?
user avatar