Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [update]

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

0
votes
1answer
62 views

UpdateSingleSalesforceObject function is updating apparently several records

I am using this function to update one record in SalesCloud. I am experiencing a strange behavior: the function is updating several records. My code is retrieving one record, and then I am using the ...
0
votes
1answer
25 views

Execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment to SObject () [duplicate]

Heres the error that I'm getting: Execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment to SObject () I believe the issue is with the following lines, which aims ...
1
vote
1answer
33 views

How to Mass Update Records Without Changing the Last Modified By Field

I have a custom object that I need to do a mass update on to set a field on each to the same value. I had written a snippet of code to execute in the Developer Console that would get all the correct ...
0
votes
0answers
16 views

Unknown mass case updates?

I have had a few instances in the past couple months where my running user is doing mass updates to cases which changes the status to Closed. I have no idea what's causing it or where to even being ...
0
votes
0answers
25 views

Updating child records of a custom object with parent object's standard controller and extension to find related children

so I have a VF page in effect that grabs the child records (Child__c) from a parent record (Parent__c) to fulfill(remedy in this case) a mass update request for the child records of the parent. The ...
0
votes
1answer
19 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
1answer
30 views

Trigger is only updating one record per batch

I have a trigger that creates an AccountTeamMember object every time there is an update to an Account_Ownership__c object (this is a custom object that we've created in house to act more in line with ...
0
votes
2answers
28 views

Use trigger to prevent the System Administrator from editing a field, but still allow Apex code to edit it

My goal: to have a field on Account that is read-only for everyone (including System Administrator) but the field can still be edited by Apex code. For example, when an Opportunity is closed as won, ...
4
votes
1answer
62 views

Log says record has been updated, but it hasn't been

I have the following code: Administratie__c theAdmin = [SELECT Artikelen_laatst_bijgewerkt_op__c FROM Administratie__c LIMIT 1][0]; theAdmin.Artikelen_laatst_bijgewerkt_op__c = ...
0
votes
4answers
73 views

Salesforce Apex to update SFMC Subscriber status

I have to write apex code on salesforce service/sales cloud to update dynamic list of Subscribers status on Marketing cloud (SFMC), I will be having list of contactkey from marketing cloud (SOQL ...
0
votes
1answer
16 views

'ExceptionOfBeforeUpdate caused by System.finalException: Record is Read Only' on a BeforeUpdate

I am getting this error Record is Read Only on my Before Update trigger... I know you get that error on an After Update when you try and change something, but not a Before Update. trigger ...
1
vote
1answer
31 views

Design Pattern for Updating Records?

A while back I wrote an Apex class to handle opportunity splits. I couldn’t use the Opportunity Splits object because there were splits on three different corporate levels (with one-to-many or many-...
0
votes
2answers
27 views

Mass update through Flow - partial updated first 2 or 3 steps

I am using flow for number of mass update through list view and custom button. It was working since last year. User select set of records (less than 200) and click custom button. It will invoke flow ...
0
votes
0answers
19 views

Mass Update Report Filters

Our Salesforce org has over 700 publicly shared Opportunity reports that have one or more report filter referencing specific Stage Name(s). Our sales team has decided to rename all of the Opportunity ...
0
votes
1answer
118 views

Script Activity error in Automation Studio

I'm trying to run a Script Activity to update specific fields of a Lead in Salesforce (Marketing Cloud connector is already configured and working properly). Once I click on 'Validate Syntax' it ...
1
vote
2answers
173 views

Are objects from For Loops passed by reference or value?

If I have a for loop that loops through results from a database query, is the single record a reference or copied value? The reason I ask is because I am attempting to update these records, but would ...
0
votes
1answer
76 views

How to do a dependent callout from a future callout

How do I send a future callout to an external system inserting an parent object and as soon as I get the response back with an external id send another callout with a child object to an external ...
0
votes
1answer
24 views

Updating a Record from VF Page

I have a VF page showing a list of records. One column displays the value of a checkbox on the record. VF page snippet: <apex:pageBlock title="List of Incidents"> <apex:...
0
votes
1answer
39 views

How to execute class or method after update external id from post callout

I have a custom object in Salesforce with a set of fields. Some of the fields I sent over by an invocable method which calls a future method to send the first set of fields to entity in an external ...
0
votes
1answer
193 views

On record edit, fields value are not populating on modal

when click on the edit button modal is showing and in that modal fields values are not populating when i check debug and console.log record id is showing and set the contact value in attribute. Apex ...
0
votes
1answer
33 views

if picklist label is queried using ToLabel() for an SObject, one cant save updates to this object if picklist is restricted

I followed the article below and got the picklist label-name instead of API name for an object. How to query 'Value' of a picklist rather than the 'API NAME', using SOQL? However ...
2
votes
1answer
41 views

Encrypted Fields Unable to Update in Apex Class - Able to Update in Apex Execute Anonymous

I am using a custom object to store Oauth credentials. I am able to update this object in Apex Execute Anonymous. I am unable to update this object in an apex class. Salesforce Connect ...
0
votes
0answers
58 views

Can System Admin bypass required (lookup) fields?

A user was trying to create a child record but they were getting an error because of other associated record has a required (lookup) field blank. But i was able to create it when i tried as system ...
3
votes
4answers
450 views

|FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object on my Apex Trigger

I'm kind of new in Apex development and I'm writing a before insert, before update trigger to a custom object that is going to be upserted through an API integration. Is very basic code but I don't ...
1
vote
1answer
37 views

How to use REST API (or preferably Restforce) to upsert and only update when field is blank?

I want to upsert Leads with the following rules: Match by Email If match is found, only update fields that are blank. Is it possible to do this by using API upsert? Is it possible to do it with ...
0
votes
1answer
69 views

After update trigger fires twice, first with no updated info, second with info

I'm writing a trigger that chops up a long-text field on an event activity record and puts it into the appropriate fields on the related contact's record. The problem is, the code seems to be firing ...
0
votes
1answer
31 views

Update record page after record is updated by calling external API

I have trigger on contact which validates phone by calling external API. To be able to call the the API from trigger, I'm using future annotation. The callout method writes the result to custom field ...
1
vote
2answers
137 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 ...
0
votes
1answer
99 views

Restrict update existing record while upserting from Data loader

I am going to load data using WorkBench/Dataloader using UPSERT (ExternalId__c) DML operation. Once this ExternalId__c is matched then we have to check one more thing like Sr_number__c in that ...
0
votes
1answer
429 views

UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 200 records - Error even after using FOR UPDATE

I have a trigger and I am calling a queueable job from trigger. Sometimes I get this error: Update failed. First exception on row 0 with id a0VN00*********; first error: UNABLE_TO_LOCK_ROW, ...
0
votes
2answers
391 views

Cannot update contentDocumentId in contentDocumentLink

I am sharing a file with a task by creating ContentDocumentLink. The LinkedEntityId points to the task record. Now, if a certain update happens to a parent record then i am trying to update only ...
0
votes
2answers
340 views

workbench cvs update set field to null

In Workbench I am query Account and I want to set ParentId to null (there are some bad id's and I want to clear them). However when I clear out the cvs file and update using workbench the values are ...
0
votes
1answer
48 views

Update list from static method

I have a static method and it has this annotation @RemoteAction so it can be called from java script, I query a list in this method and I want to change a field value and update the list, this doesn't ...
0
votes
2answers
16 views

How do I use the Java API to update only a single attribute on a record?

I'm using Java 8 and v 33.0 of the SalesForce API. We are trying to update a single field on a record. Basically we are trying to do it like this final CventSession__c ...
1
vote
1answer
255 views

Need to set Shipping Address to Billing Address when Account Type is A or B

I'm really new to this platform (one week barely, although the programming logic is the same for everything) and I'm not able to solve this. I have added two new choices to the Type picklist of the ...
0
votes
1answer
239 views

Using Maps instead of nested for loops in APEX

Hi i'm really new to Salesforce development in the following code I'm trying update existing record to inactive but, not the coming record on two different conditions. I'm a bit confused in the last ...
0
votes
1answer
27 views

Need to send data through API upon record update

I am trying to push data through the API to a semaphore box when the following occurs. I am a complete beginner and need help writing this apex class: We have data submitted through a form to start a ...
0
votes
1answer
58 views

Anonymous window Too many SOQL queries: 101

I've tried to execute the following script: List<Task> taskList = [SELECT status, CalculatedWorkingHours__c FROM Task WHERE CalculatedWorkingHours__c = -1.0 AND status = 'Completed']; ...
0
votes
1answer
237 views

Can't change picklist-field value in apex

I have to insert a new record that has a field with of type Picklist (Multi Select), and I get this error trying to insert: TestValue is a value already added in the values list. bad value for ...
0
votes
1answer
31 views

Pass Subject and Description in new Case

I have an after insert trigger that is updating cases and I want to be able to pass Subject and Description on with casesToUpdate. Below is the code. I do not want to change the Subject or Description ...
1
vote
2answers
90 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
86 views

How to tell which Validation / Workflow rule caused exception?

I am using a batch class to mass change the case owner from one queue to another, but during the update process I am returned the following exception: FATAL_ERROR System.DmlException: Update failed. ...
1
vote
1answer
237 views

Getting error: 'Update Failed… DUPLICATES_DETECTED' even with duplicate rule set to 'Allow'

I am trying to update a list of Contacts which is failing because of duplicate being detected. My duplicate rule field 'Action on Edit' and 'Action on Create' is set to Allow. code: if(...
2
votes
2answers
27 views

Update Existing Historical Bulk Records to fire a trigger

I need help with updating existing bulk records just for the sake of firing a trigger. Below is my situation: We have more than 1 million contacts in our org. Recently we installed a managed package....
1
vote
1answer
113 views

move all child records from one account to another efficiently

I did a bit of searching and didn't come up with anything so apologies if this is a duplicate, but - Situation: I am looking for a way to migrate all related object records from one (bad) account ...
1
vote
2answers
50 views

Best way to process the records in After Update triggers - Sets or Lists

This may be a very primitive question but am failing to choose the best way and am trying to follow the best practices. We have many Salesforce Apps implemented, as a result there are many record ...
0
votes
1answer
72 views

Update record in custom Object and Table

I have a table that is populated from values from a custom object. For each record, I have an <apex:inputField> that shows the Quantity value for a record and the user is able to modify the ...
4
votes
2answers
196 views

Adding to a List changes all previous additions

I've been working as a developer for about 3 months, so my terminology may be off. I'm trying to add records to a custom object. As the new record information is added to a List, the previous ...
0
votes
0answers
27 views

Updating Child records from upadting a field in child record

I have created four contacts for an account. I want to update child records of an account.If I update lastname in first record of my contacts to 'AAAA' then the lastname for the remaining three ...
1
vote
1answer
33 views

Not able to update records using trigger

In a trigger I am trying to update values of child records which are pulled from a perent record. I can see the updated data in the debug statements but the actual records are not getting updated. ...