Skip to main content

Questions tagged [transaction]

Filter by
Sorted by
Tagged with
1 vote
2 answers
704 views

Platform Events a nightmare - How to make them work in real life

I am trying to build a Platform Event-based application logger where arbitrary application code calls Tracker.log(...); and this is sent as an Event into an external database via an API. As it's ...
Robert Sösemann's user avatar
0 votes
2 answers
74 views

If a user can access only the salesforce UI, will there be multiple transaction for that user?

Please correct me if I am wrong. Somewhere I read an article that each account has their own separate transaction. Also, I don't think that customers will be using Developer Console to update or ...
ratRiot01's user avatar
2 votes
1 answer
915 views

The need of database.savepoint vs not using try catch at all

This has been something that has been really bugging me. What is the need of using using a database.setsavepoint along with try catch when you can just do without it? With try catch and savepoint. ...
codingislife's user avatar
1 vote
1 answer
258 views

Can later runs of a flow see records inserted in an earlier run of the same flow interview?

I am running into a strange problem with a flow that has lead me to wonder if I am not understanding how flow interviews work on bulk inserts and I am not able to find any documentation that answers ...
Frank Evers's user avatar
3 votes
1 answer
619 views

Salesforce Bulkification Across Transactions

Here is a fun question I have been puzzling over. So, I have been learning a lot lately about salesforce bulkification and governor limits, specifically as they relate to bulk upload of data into ...
Luke Sharon's user avatar
1 vote
0 answers
488 views

Salesforce Flow Pause Element error

I have a salesforce flow that is an invoked flow from a button click on a list. After clicking the button, I send the ID of the parent record to the flow, and get all the child records with a get ...
Luke Sharon's user avatar
1 vote
0 answers
120 views

Before-Save Flow in separate transaction from Apex + after-save Flow?

I expected before-save Flow + Apex triggers + after-save Flow to be a single transaction. However, when set Debug Logs, I get two entries. One contains my contact before-save Flow, then a second ...
David Cheng's user avatar
  • 7,434
1 vote
1 answer
118 views

Too many DML statements 151 inside while loop

I am receiving this error on Update DML inside while loop I have marked the error line in code Code public class LeadFuture_TradingAccUpdate { @future(callout=true) public static void ...
Yogesh Sakat Aphidas's user avatar
0 votes
1 answer
987 views

How transaction creation happens with multiple record triggered flows for the same object?

After searching and searching I get more in doubt on how the transaction works in salesforce. I want to believe that if I have one big record-triggered flow it will be run in the transaction of a ...
Jonas Lopes's user avatar
4 votes
1 answer
2k views

Is sfdx force:source:deploy a transactional command? Could it be?

I'm looking for a transactional deployment command, that will roll back the entire metadata movement in case of an error. Deploying by using an artifact with sfdx force:mdapi:deploy --zipfile ... is a ...
Manuel Moya's user avatar
0 votes
1 answer
570 views

UpdateAsync(sobject) Method to update records in a (spawn) new transaction

The documentation says that data on the external system. Asynchronous operation is used to process\update these records Query Does this mean I can update Sobjects (custom and\or standard) using this ...
IHaveAQuestion's user avatar
0 votes
1 answer
158 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 ...
ZackOne's user avatar
1 vote
0 answers
25 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 ...
Ihor M.'s user avatar
  • 111
9 votes
3 answers
8k views

Best practice for using static variables

I have seen classes having 100s of static variables defined. They are there for different purposes and I don't think, mostly are used in single transaction. They are used in different transactions. ...
Rajendra Singh Nagar's user avatar
0 votes
1 answer
3k 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?
Amit Kumar's user avatar
1 vote
2 answers
1k 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 ...
willeg's user avatar
  • 323
0 votes
0 answers
49 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 ...
EK1's user avatar
  • 38
0 votes
1 answer
385 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 ...
CRK's user avatar
  • 121
1 vote
1 answer
713 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 ...
David Cheng's user avatar
  • 7,434
-2 votes
1 answer
197 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 ...
user61140's user avatar
1 vote
1 answer
3k 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 ...
Morgan Marchese's user avatar
1 vote
1 answer
1k 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 ...
Morgan Marchese's user avatar
2 votes
1 answer
959 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 ...
Ken K's user avatar
  • 33
1 vote
0 answers
211 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 ...
rStrunk's user avatar
  • 67
1 vote
1 answer
1k 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) ?
Nitish Yadav's user avatar
1 vote
1 answer
426 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 ...
ipradhansk's user avatar
  • 2,337
0 votes
1 answer
89 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 ...
GOPAL Y's user avatar
  • 61
0 votes
2 answers
1k 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 ...
sfdcnewbie's user avatar
2 votes
1 answer
711 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: ...
AshK's user avatar
  • 43
2 votes
0 answers
101 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 ...
Keshav Rathore's user avatar
3 votes
1 answer
309 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 ...
Olivia's user avatar
  • 3,491
0 votes
1 answer
123 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:...
Lukas's user avatar
  • 103
5 votes
4 answers
8k 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?
Robs's user avatar
  • 9,426
0 votes
0 answers
466 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 ...
lambad's user avatar
  • 385
0 votes
2 answers
733 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 ...
Noor A Shuvo's user avatar
1 vote
1 answer
649 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 ...
Robert Sösemann's user avatar
8 votes
2 answers
3k 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 ...
Robert Sösemann's user avatar
1 vote
1 answer
2k 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?
Jean David's user avatar
2 votes
1 answer
377 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 ...
VBALearner's user avatar
0 votes
1 answer
679 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 ...
denvergreene's user avatar
  • 1,218
2 votes
2 answers
1k 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?
Pericle Parquet's 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 ...
Jake's user avatar
  • 111
2 votes
1 answer
727 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, ...
javanoob's user avatar
  • 8,957
3 votes
1 answer
3k 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 ...
Sagar's user avatar
  • 67
0 votes
0 answers
112 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 ...
ipavlic's user avatar
  • 3,766
3 votes
2 answers
829 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....
WenHao's user avatar
  • 315
3 votes
2 answers
5k 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 ...
Robert Sösemann's user avatar
9 votes
2 answers
2k 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 ...
Yury Bondarau's 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 ...
MatthewGTS's user avatar
1 vote
2 answers
3k 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 { ... ...
dwright01's user avatar
  • 223