Questions tagged [update]

An UPDATE statement changes the data of one or more records already existing in a table.

Filter by
Sorted by
Tagged with
8
votes
4answers
3k views

Workarounds for Sites page to update standard object?

I have a client who wants external users to submit data via a Sites VF page and update Opportunity records. Of course the Sites profile doesn't have permissions to update standard objects. Also, the ...
10
votes
6answers
53k views

Trigger to update parent object value with child value

In my company we are using Oppotunity standard object and we have created a custom Quote object. The opportunity object is the parent and Quote is the child. How has to be the trigger in order to ...
22
votes
2answers
10k views

Database.SaveResult.getId() returns null

I'm trying to update an account list and I need to get the Ids when the update fails. I use the getId() method but for accounts which fail I get null. It's an update so my account already has an Id. ...
1
vote
2answers
342 views

Does Database.SaveResult, Database.DeleteResult, etc. implement a public interface?

The various DML operations (insert, update, delete, etc.) all return results with very similar methods and properties. It is not uncommon, as a developer, that I should want to handle these results ...
9
votes
1answer
723 views

Is upsert properly ACID compliant?

Given an object Table_A with one unique field Unique and two rows: row Unique --- ------ 1 A 2 B And the following class: public class KeySwapDML { public void ...
3
votes
2answers
14k views

Problem with Database.update()

I have some accounts to update but some validation rules can failed. So to avoid this I use the Database.update() function to update accounts even if some DML exception occur. try { List<...
4
votes
1answer
1k views

Question regarding “RunOnce” Booleans on AfterUpdate methods in a Salesforce Transaction

I recently encountered a business logic bug in our org that was accidentally deducting a customer 2x for completing an event that only actually occurred once. Using dev console I was able to determine ...
4
votes
2answers
284 views

Salesforce Timing/Cache issue ?? Update record before generating a VF PDF

I have a custom button which generates and sends an invoice pdf. Just before to generate the pdf, if the issue date of the invoice is null, I set the date to today, then I generate the PDF. The code ...
2
votes
2answers
527 views

Trigger Is not working on opportunity while insert

I have a trigger in opportunity in trigger on update and insert. It was working until today but suddenly gotta stuck. It is working fine while update but while inserting it is giving error like ...
2
votes
1answer
216 views

Need Child Account Trigger Help

I am trying to update all child accounts to have the same Order Manager(lookup to Contact) as their parent. The caveat is that I only want to do this for accounts that arent parented by my two top ...
2
votes
2answers
497 views

Error when Update QueryDefinition with SOAP API

I try to update an existing SQL query activity in Marketing Cloud with SOAP API but I keep getting the same error. The request I send is this: <?xml version="1.0" encoding="UTF-8"?> <s:...
1
vote
0answers
355 views

Update user object using SOAP Api

I am trying to update a custom field on User object from Java using soap api (Enterprise wsdl) and getting below error [InvalidSObjectFault [ApiQueryFault [ApiFault exceptionCode='INVALID_TYPE' ...
1
vote
2answers
203 views

Apex Trigger Update Case With Account Id Bulk

I have created an apex trigger that will update the accountId on the case. I don't think this will work for bulk inserts and was wondering if someone could glance at this and suggest an edit or to. ...
0
votes
1answer
105 views

Salesforce method to update doesn't get commited

I have an apex class which contains the method with parameter(code below). I'm calling this method from a trigger after update and the method makes some updates to a couple objects. My issue is that ...