Questions tagged [transaction]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
41 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 ...
-2
votes
1answer
34 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 ...
1
vote
1answer
113 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 ...
0
votes
1answer
96 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 ...
0
votes
1answer
94 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 ...
1
vote
0answers
34 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 ...
0
votes
1answer
321 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) ?
1
vote
1answer
110 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 ...
0
votes
1answer
42 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 ...
0
votes
2answers
409 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 ...
2
votes
1answer
207 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: ...
2
votes
0answers
55 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 ...
3
votes
1answer
91 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 ...
0
votes
1answer
84 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:...
1
vote
4answers
2k 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?
0
votes
0answers
197 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 ...
0
votes
1answer
303 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 ...
1
vote
1answer
313 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 ...
8
votes
2answers
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 ...
1
vote
1answer
695 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?
2
votes
1answer
149 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 ...
0
votes
1answer
176 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 ...
2
votes
2answers
506 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?
1
vote
1answer
1k 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 ...
1
vote
1answer
200 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, ...
3
votes
1answer
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 ...
0
votes
0answers
38 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 ...
3
votes
2answers
596 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....
2
votes
2answers
2k 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 ...
9
votes
2answers
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 ...
9
votes
1answer
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 ...
1
vote
2answers
1k 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 { ... ...
0
votes
1answer
49 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 ...
3
votes
1answer
821 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 ...
0
votes
0answers
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 ...
4
votes
2answers
286 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 ...
0
votes
1answer
205 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 ...
2
votes
1answer
164 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 ...
2
votes
1answer
743 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 = ...
7
votes
1answer
356 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....
0
votes
1answer
548 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 ...
1
vote
1answer
167 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 ...
11
votes
1answer
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?
1
vote
0answers
96 views

Questions on row locking/transaction control

I have a process that first reads a custom setting value to use in a numbering scheme (can't use auto-number), it +1 that value, updates it, then does a number of DML/logic code which can take a ~2-10 ...
0
votes
1answer
47 views

Email One Click Buy

Does anyone have a suggestion how to implement a one-click purchase mechanism via SFMC email? Intending for a customer to receive an email, when they click the CTA button, it automatically ...
3
votes
3answers
824 views

Testing system rollback, i.e. when exception is thrown outside without handling

On our community website we have some logic which throws exception when some set of conditions is invalid. This exception is not handled by any part of our code. As result system rollback happens ...
2
votes
0answers
187 views

When does System.abortJob() take effect with regards to a transaction?

If I call System.abortJob() in a transaction, when is the job actually aborted? Does it happen immediately, or only once the transaction is committed? I suspect the latter, as you don't want to have ...
3
votes
1answer
105 views

Time Dependant Workflows and transactions

The environment setup is as follows: 1) there is a workflow triggered by some criteria which has a time dependent action which will update a field on the object. 2) With apex-code I update a List of ...
0
votes
1answer
67 views

How to implement transaction with php Toolkit

is it possible to implement transaction with php toolkit? I have to insert data into 2 objects. If there is any problem during the second insert, I would like to rollback the first insert.
1
vote
1answer
106 views

I need to pass along with the dollar amount AND the Confirmation # for a transaction to ET Tracking

Is it possible to attach a confirmation number from My Website once a person transacts to ExactTarget tracking so that I'm also able to see it in the feed that comes through with the dollar amounts? ...