Questions tagged [rollback]

The tag has no usage guidance.

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

When method called 2 times: Uncommitted work pending. please commit or rollback before calling out

I have a method: public static CreateUpdateAPI (Account acc) { //do WS callout //perform DML } When i call it from Anonymous console with one Account it runs properly. But when i call the ...
1
vote
0answers
51 views

How to rollback metadata changes using Jenkins and bash script

I am working on a project in which I have to rollback the metadata components which we have deployed into destination org using Jenkins. Does anyone have built this kind of project / Scenario. Steps ...
0
votes
1answer
64 views

[apex]: Database.rollback(sp) not rolling back in my trigger

I am playing around with Database.setSavePoint() in a trigger. I put it at the top of my BeforeUpdate method and then I roll back at the end of the method. Then I try to modify an Opportunity record ...
1
vote
1answer
71 views

Rollback of a transaction in case of Gov Limit Error while using AllOrNone false

Will the entire transaction be rolled back in case of Governor Limit exception if I have fired some partial saves done? e.g. if the gov limit exception of 100 SOQL is hit while execution of contact ...
0
votes
1answer
20 views

How to handle failed updates when updating multiple Records in List

I have a Apex job that runs every night to change a field in multiple records. I've added some validations to the Object that are preventing some records from being saved. The problem is even tho ...
0
votes
0answers
81 views

@future method not getting called from catch block

I am calling a webservice (synchronous) and in case of CalloutException, I'm trying to create an error log in a custom object. The problem is, the record insertion is happening in a future method and ...
0
votes
2answers
159 views

How many times a database.rollback executes?

Below is the code I am executing. Account a = new Account(Name = 'xxx'); insert a; System.assertEquals(null, [SELECT AccountNumber FROM Account WHERE Id = :a.Id]. ...
0
votes
1answer
438 views

Future method rollback

I have a System.LimitException problem: Apex CPU time limit exceeded in Apex, and I have therefore modified a synchronous functionality in asynchronous functionality by changing the method in @future. ...
3
votes
0answers
218 views

Queue/Serialize Incoming REST API Requests

I'm looking for a way to queue incoming HTTP Post requests. Apex REST API handlers are executed in parallel on separate threads. This introduces race conditions if any new records are inserted by ...
1
vote
1answer
89 views

Callouts and rollbacks

Let's say I call out to an external service, get some results, use them in a transaction which then crashes. As a result, the transaction is rolled back. The same effect can be achieved with save ...
1
vote
1answer
343 views

Rollback all completed jobs in a chain

I'm writing an application where I'm chaining jobs by calling executeBatch for the next job in the finish method of the previous one. In case a job somewhere in the chain fails, I'd need to rollback ...
4
votes
2answers
277 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 ...
1
vote
2answers
495 views

TypeException: Savepoint does not exist in this context

Is there a limitation that prevents unit tests from calling a class that uses the Database.rollback functionality? I am getting this error: System.TypeException: Savepoint does not exist in this ...
5
votes
1answer
164 views

How can I add transactional safety to Javascript DML operations?

I am using connection.js and apex.js to add DML operations to a custom VisualForce page with sforce.connection. There are actions in the page that can make multiple calls that will alter data. I'd ...
2
votes
3answers
512 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 ...
3
votes
2answers
3k views

How to roll back a code deployment from sandbox to production

I'm reading about the Salesforce development lifecycle, but I can't figure out whether (and if so, how) Salesforce provides for rolling back a code deployment from a sandbox to production.
3
votes
3answers
398 views

Revert/rollback record states on error

Consider the following block of code that is called on save of a basic data entry page: public PageReference save() { // accounts is binded to VF page for (Account a : accounts) { ...
1
vote
1answer
710 views

Use addError method and make a DML operation

The problem that I am having is that I am using addError method in before insert trigger which actually rollback every DML I make including @future method calls, sending email, queueing batch jobs, or ...
2
votes
1answer
66 views

PHP API: Rollback behavior with multible Querys [closed]

My system imports large tables into salesforce. I want the all or nothing behavior, specified here But i can't find the corresponding function in the php SDK. Does this functionality exists in the ...
0
votes
1answer
319 views

Setting database.savepoint in one method and rolling back in another method

I have three objects ObjectA, ObjectB, ObjectC. ObjectA is the grand parent, ObjectB is child of A & Object C is child of B. I'm providing a button on ObjectA page layout to create/edit records ...
2
votes
1answer
268 views

Rollback complete batch process

I want to roll back a complete batch related transaction if there is any exception while processing anywhere during batch execution I can roll back that specific transaction, but not sure if I can ...
1
vote
1answer
196 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) { ...
2
votes
1answer
374 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 ...
33
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 ...
2
votes
0answers
283 views

Send email in an Apex trigger (on CollaborationGroup) before calling addError

I want to have a trigger on ColllaborationGroup (Chatter group) that prevent users from deleting a group, and sending them an email for explanation. I read here and here and here that this is not ...
0
votes
1answer
103 views

Finding & Evaluating Salesforce Backup & Recovery Service Providers

Realize that anything a third-party Salesforce backup & recovery service is able to do in theory I am able to do, but short-term, I am more focused on deploying Salesforce, than recovering it. ...
3
votes
3answers
2k views

Can I rollback a Before Insert trigger from an after trigger event?

Scenario: After an object is inserted/updated (can happen after any of the two) - I update an external system with that object's info - Object ID is needed - which is why I need the After Insert. ...
1
vote
1answer
89 views

when trying to attach it getting rollback problem

I have created a VF page for generating invoice and from that VF page i am invoking a PDF VF page. In invoice VF page i saved the invoice and pass the parameter to PDF page and trying to display it. I ...
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 ...
12
votes
2answers
225 views

Are Custom Settings included in a Database.rollback()?

Apex has a Transaction Control system for rolling back changes to SObjects. Are Custom Settings included in a rollback? (To be more clear, are Custom Settings reverted to the state that they were in ...
1
vote
1answer
209 views

Rolling back custom field change

Is there a way to get the prior values of a custom field for which history tracking was not setup for and neither was a PRIORVALUE field update field created for it. Thanks.
25
votes
3answers
6k views

Can I prevent an insert to be rolled back even if my class (later) runs into an exception?

I do some custom logging in my code which basically means I write and update sobject records that contain custom log information. The problem is whenever an exception is thrown in my class the ...
11
votes
3answers
10k views

Is manual Database.setSavepoint() and rollback needed on Trigger exception?

When something wents wrong in my synchronous trigger do I have to manually take care of this by before making a Database.setSavepoint() and rollback in the catch statement? Or is Salesforce.com ...
8
votes
2answers
2k views

Can we have a DML not roll back when i use an adderror method?

We have a scenario where in the before insert trigger of object Asset, which looks for a duplicate and if a duplicate is found a record is inserted in the junction table and after the dml is complete, ...
11
votes
2answers
7k views

Rolling back DML operation in Apex method

What is the best way to rollback some changes to the database inside an Apex method? For example, in an Apex method, I insert multiple records (Opportunity / Quote / QuoteLineItems). When I execute ...