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
14 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
votes
0answers
36 views

Update Contact field [on hold]

This code is working fine in my org but why it is not working in sandbox? global class Fs_AllActiveBadgeBatchClass implements database.Batchable<sobject>{ global database.QueryLocator ...
1
vote
1answer
27 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
20 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
15 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
47 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
49 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
23 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
32 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
63 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
26 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
31 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
44 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
305 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
28 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
48 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
28 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
82 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
66 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
163 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
201 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
1answer
133 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
43 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
15 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
116 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
156 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
23 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
40 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
139 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
29 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
70 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
58 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
117 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
23 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
105 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
46 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
51 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
145 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
26 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. ...
0
votes
2answers
478 views

Update an object field

How could I go about updating a field value of an object? For example, I have an object of type A and its id is 474xxxxxxx. The object of type A have a field f which type is a Picklist. I have a ...
0
votes
1answer
101 views

Adding an update to a Select Query

I have the following query I'm running to fetch records where the Order_Exported_to_A = False and I want to update that field to True once that record is pulled. SELECT Name, ...
1
vote
2answers
251 views

Update field datetime to NOW() when chatter added to case

At present I am trying to use a workflow rule to update a field (Last Chatter Date/Time) which I have set to update whenever an update is added to a case. At present chattering on a case doesn't seem ...
0
votes
2answers
173 views

Referencing WhatID in tasks?

I have a lookup on Teams called Managers (User Lookup). When a task related to Teams is completed, I want to update a field on tasks called match and also update a field on Teams called completed ...
1
vote
1answer
42 views

Array is not updating when the reference which was passed as an argument to the component is updated

Array is not updating when the reference which was passed as an argument to the component (in which update does not happen) is updated. Let me provide the code first. campingApp.app : <aura:...
3
votes
1answer
52 views

How to merge methods into one

How can I merge these two methods that just set the date for child records when the parent record changes? Or should I just keep them separate? public with sharing class Tables { public static ...
-2
votes
1answer
107 views

Update a field when click on the link in an email [closed]

marketing manager will send an emails to customers. in the email template there would be 2 buttons, Optin and Opt-Out.depends on the button customer clicked, need to update a field in salesforce....
1
vote
1answer
647 views

force:recordData for Update OR Create

I can't seem to allow force:recordData to update records. I am able to make it create new records without any problem. I think the problem is in the attribute of the component? Or perhaps I am not ...
0
votes
1answer
183 views

Create Child Record if a lookup on a Parent Object Changes

I'm pretty close to being maxed out on workflows for my custom objects. So I decided to see if apex classes could help, I'm still currently trying to learn how to write triggers and classes so Im ...