Questions tagged [transaction]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
1answer
13 views

Update customerKey of Content & Data Extension in Email Send Definition for a Transactional Message [on hold]

I created an Email Send Definition for a Transactional Message and I need to update the Email Content as well as the data Extension Customer Key. I created it via API as described in this ...
0
votes
3answers
45 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
29 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
19 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
32 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 ...
0
votes
0answers
33 views

Restrict internal users to 'Login as Community users ' when 'Manage External User' permission is enabled

Is there a way to restrict internal users to 'Login as Community users' when 'Manage External User' permission is enabled . We want this permission since the internal user should be still able to ...
4
votes
1answer
106 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 ...
0
votes
1answer
133 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
77 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
96 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 ...
1
vote
2answers
157 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
556 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
56 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, ...
1
vote
1answer
604 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
26 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
282 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....
0
votes
2answers
661 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
739 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
502 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
505 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
46 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
343 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
274 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
89 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
74 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
519 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
294 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
246 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
133 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
1k 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
78 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
40 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 ...
2
votes
3answers
442 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
101 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
82 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
62 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
90 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? ...
11
votes
4answers
1k views

In Apex, what is the difference between the “execution context” and a transaction?

What are the boundaries of the execution context? What are the boundaries of a transaction?
4
votes
2answers
993 views

Multi-object create/update/delete? Use select SOAP APIs from REST client?

I have a client calling various SF REST APIs. So far so good. Unfortunately (and inexplicably in my opinion), object create, update, and delete operations can handle 1 object per REST API request, ...
1
vote
1answer
188 views

Field not writable after Database.rollback() and clone()

This is my custom save method: private void saveNewMode() { Savepoint toBeforeState = Database.setSavepoint(); try { insert parent; for(ChildA__c prs : childrenA) { ...
1
vote
2answers
137 views

Which custom save() is better?

Sometimes in code examples of custom save methods (of controller extensions) you see the use of try/catch and an explicit translation of Exception to PageMessage. Explicit Error Handling: public ...
4
votes
1answer
3k views

How to commit after Database.setSavePoint()

I have a batch Apex job that is currently wrapped in a single transaction, so that any exceptions will roll back the entire batch job. I'm fighting locking issues in SF, and as part of this, I'd ...
2
votes
1answer
326 views

Transaction rollback

I am hoping if you can help clarify the rollback on transactions, for scenario below. For example if we have the piece of code below MyCustomObject__c customObj = new MyCustomObject__c (); Savepoint ...
2
votes
1answer
533 views

Problem with sending an email that uses a custom component/controller

I've put together a Visualforce email template for cases and I'm running into an issue with it that only occurs when the case is initially created. The component pulls a list of related records from a ...
32
votes
10answers
2k views

How can I cause side effects outside an execution context?

I've got a scenario that relies on the system's "automatic rollback" behaviour to undo any DML, emails, futures and so on, in the case of an error. Basically, by allowing code to throw an unhandled ...
7
votes
1answer
209 views

Is it possible for two users to update separate records in the same transaction?

This requires a little context... I want to create a trigger that only fires when one record is being updated. It's a trigger that shouldn't be fired with bulk data manipulation. I've set it up so ...
3
votes
3answers
739 views

Transaction Control for multiple batches

Is it possible to implement transactional DML for batches? for example we have parent object and child and if the update of child object is failed then the update of this particular parnet and child ...
11
votes
1answer
1k views

Transaction isolation in Salesforce

As far as I understand Salesforce supports optimistic (by default) and pessimistic (using FOR UPDATE) locking for records. But what about transactions? If there direct analogy for typical SQL ...
3
votes
2answers
2k views

Does Database.rollback(savepoint) work with the Update method?

I have 3 objects A, B and C. First A object which contain some amount of records. And I need to update or create a new record to the second B object. The condition is, if the user exist in the second ...