Questions tagged [upsert]

All queries related to Upsert can be grouped under this Tag

Filter by
Sorted by
Tagged with
1
vote
1answer
508 views

Updating an existing Object fails with error INVALID_FIELD_FOR_INSERT_UPDATE

This is the exact error : from smartSync SFLogger ERROR com.salesforce : Sync type:syncUp id:6 FAILED cause:Server call for sync up failed error:Error Domain=CSFNetworkErrorDomain Code=400 "Unable ...
1
vote
0answers
17 views

DataLoader batch job failing with PricebookEntry upsert

I have an issue with our PRICE BOOK ENTRY Upsert using the DataLoader batch bulk job. We have External IDs in our PRICE BOOK and PRODUCT objects that we use when Upserting to our PRICE BOOK ENTRY ...
1
vote
2answers
513 views

Second Upsert does not update an AccountContactRelation

On AccountContactRelation we are using an external Id custom field Account_Contact_Id__c as the upsert field. The first upsert for a particular ACR is succeeding in creating the ACR. However, further ...
-2
votes
1answer
39 views

Check if upsert necessary

I am using external id and rest callout to another org, but is there a way to check if i need to make callout? Cause callout called even if all fields are the same. I can compare all fields, but its a ...
0
votes
1answer
28 views

Rest upsert callout

How can i make an upsert callout? I have object Contact with custom ExtId with Custom_Object__c id. So i am tried post, patch method and without/with '?_HttpMethod=PATCH'; What do i need to do? I ...
0
votes
0answers
14 views

lightning:recordEditForm does not updating, just inserting

I used lightning:recordEditForm in my aura component file and save button function is okay but I want update an already existing record.. When I click the 'save' button in edit page, a new record is ...
0
votes
1answer
795 views

How Does Upsert Work When No External Id Is Specified?

I have looked at the documentation on Database Methods. What I do not understand is, what happens when an upsert is performed without specifying an external id field? Is it just based on whether or ...
1
vote
1answer
1k views

How do i Upsert record in Parent- child relationship from custom to custom object Using External ID

We have data integration Job for SQL SERVER - SFDC using Talend data integration tool. SFDC environment: Full sandbox Account We have two custom object. In that, Master-Detail relationship from ...
0
votes
1answer
72 views

Workbench upsert: how to use an External id?

I want to update a number of Cases using a CSV file that contains two fields: case number (NOT technical id, but the automatically generated human readable id/name) and a textual complaint. Data ...
1
vote
2answers
1k views

UpsertData and DeleteData not working

I am using this AMPscript in a Landing Page, and it seems to prevent the page from displaying anything %%[ SET @SubscriberKey = QUERYPARAMETER('SubscriberKey') SET @Operation = '...
0
votes
2answers
570 views

Upsert not updating existing rows with visual force fields

I have a custom VF page and a custom class. There are several fields on the page. When Submit button is hit, a new row will be inserted if does not exit or the row will be updated if it already exists....
4
votes
1answer
948 views

What are Best Practices for Upserting Objects with Foreign Key Members (i.e. References to Other Objects)

I want to upsert objects through the .NET-ForceClient into our Salesforce, more specifically, I want to insert or update an object that contains a reference to another object. As a simple example, ...
0
votes
1answer
709 views

Can't update existing record with external ID

I have this script that gets time entries from a time tracking tool and that I'm trying to push into a custom object in Salesforce : Time_Entry__c. After following this help page : https://developer....
1
vote
1answer
169 views

Python Simple Salesforce - Upsert to CampaignMembers Object

I am trying to find an automated way to add contacts & leads to existing campaigns by using simple salesforce to upsert records to the CampaignMembers object. I have a CSV file with CampaignId and ...
0
votes
1answer
71 views

Upsert list<SObject> with external id

I want to upsert a list of generic sobject with the external id field. This list of generic sobject contains records from different sobjects, where the sobject type will be unknown and will be ...
0
votes
0answers
179 views

stripinaccessible stripping fields for system administrator

I have a generic function to validate CRUD before DML which uses stripInaccessible(). public static SObjectAccessDecision validateCRUD(AccessType access, List<SObject> records, Boolean ...
0
votes
1answer
41 views

Is it possible to perform upsert operation on UserTeritorry2Association?

I am writing a batch class on the UserTerritory2Association SObject and I need to perform an upsert operation. I have tried to use insert and records are getting created but if I need to do upsert I ...
0
votes
1answer
22 views

upsert operation using IdLookup

I want to perform insert and upadate operation on Account on same record by using following query but It inserts two accounts with different descriptions Account acct = new Account(Name = 'practice ...
0
votes
1answer
16 views

can we insert a date value when the Closing date on opportunity is Null using a before trigger?

we are using dataloader to upsert records into Opportunity object but there might a case where there is no Closing date for some records, in that case, can we insert a particular date value using ...
0
votes
2answers
78 views

Update both Pricebook2 and PricebookEntry objects using just one for loop

Having the next code: for (WrapperTest pb : pbs_lst) { Pricebook2 newPB2 = new Pricebook2(); PricebookEntry newPBE = ...
0
votes
1answer
72 views

The Query Cost of UPSERT

In an Apex Test, I'm getting the 'Too many SQL queries: 100' error. Quite a lot happens in the code that is called (it's an API endpoint, not just a single function) and in one scenario, the end point ...
0
votes
1answer
27 views

Block an insert call or convert it to upsert in trigger

Zapier connects our forms to our Salesforce instance. However, Zapier does not provide an upsert call as a way to insert a record, only insert and update. This means we have to use up more of our ...
0
votes
1answer
43 views

Upsert without an external Id

We have external system that is pushing an event using Platform events saying that an asset is changed. I have created a Platform event object and a trigger on it, make a webservice callout to get ...
0
votes
0answers
28 views

Before Insert or Upsert list must not have two identically equal elements when tried with JSON String

I have tried to get the JSON String response and map the value for both insert and update but I got the above error .please check whats my mistake. try{ Http http = new Http(); ...
0
votes
1answer
67 views

Upsert DML Operation

Consider the below code. I thought the way upsert DML works is that if it sees that there is a new record with matching key (here in this case there is already an account with Name = Acme and ...
0
votes
1answer
48 views

How can I update opportunity / account / product with a Json that gives a web service as a response?

enter code here currently the web service receives as a parameter a Json that is sent with salesforce information of opportunity / account / products. In turn, the web service generates a Json ...
0
votes
0answers
65 views

Apex upsert duplicate external id specified error

Long time listener, first time caller (and apex-er). I have a class to copy subscription items to a custom ARR Sub Line object; from there I can use out of the box rollups to pull my ARR onto ...
0
votes
1answer
83 views

How to update Email Opt Out field?

Is there any way to update the Email Opt out field ? this is OOTB field in SF but when i trying to save my code IDE told my " field is not writeable" The API name is IsEmailBounced
0
votes
1answer
75 views

Bulk API upsert error for a Field type Location

I'm using the Bulk API v2 for upserting data into a CustomObject. When i try to upsert data without the CustomField Location, it works correctly, but when i add in the CSV the Location__c header, i'm ...
4
votes
1answer
3k views

Can I upsert PricebookEntry Records?

Is it possible to upsert PBE records? According to the API document, upsert is a supported function. Now that we can create custom fields on the PBE, I even added an external ID field, but I cannot ...
0
votes
0answers
80 views

Use Database.upsert with external id field is not working on PricebookEntry object

I need help to do a DML operation with external id field. I am using the below syntax, but it is throwing an error Schema.SObjectField f = PricebookEntry.Fields.Product_Code__c; Database.UpsertResult[...
0
votes
2answers
331 views

Force RecordTypeId to Null on Contact

I am working in a very old org where majority of the contacts do not have a recordtypeid, and contact visibility, page layout assignments revolve around this master no record type id contact record. ...
0
votes
0answers
64 views

Dealing with failed records in an Upsert operation

With the help of responses to my previous posts I was finally successful in Upserting Contacts in Salesforce via Jitterbit using External Id. However two records failed. I am thinking these failed ...
1
vote
1answer
292 views

Check if Parent record exists using parent's External Id before inserting child

I have a child__c object that has a lookup relationship to Parent__c. Each have an ExternalId__c field in them. I am trying to create this relationship when inserting a child record. List<...
0
votes
1answer
56 views

UpsertDE with Composite Primary Key for Journey Activity Tracker

I'm attempting to create a Journey Activity tracker for a DE with a Composite Primary key of [Subscriber Key], ContractID, and ContactId. Here is what I've attempted to insert within each email and it ...
2
votes
1answer
517 views

How to prevent an upsert from overwriting fields with existing values with null?

I have an object that I update overnight by getting data from an external system. In the callout I cast the data into my object and do an UPSERT with external ID. It all works correctly apart from one ...
0
votes
1answer
79 views

How to run upsert in salesforce using firstname + lastname + email [closed]

I am using salesforce object as target in Informatica. The source is a csv file. I want to run upsert function in salesforce with a matching criteria Firstname + Lastname + Email. Right now I have ...
1
vote
1answer
709 views

FLS Create for upsert

How manage FLS Create issues in Checkmarx for upsert statements ? I use isCreateable() for insert and isUpdateable() for update. But for upsert, I don't know what function I have to use (one or both)...
1
vote
1answer
389 views

Salesforce Flow Opportunity to Order Errors

I have an interesting workflow and maybe that is what needs to change. Right now I have Shopify front end and am using Zapier to take orders from Shopify and create accounts in Salesforce as well as ...
0
votes
1answer
1k views

Foreign Key External ID not found even though value exists

When performing an upsert operation via Mulesoft on a record that is a child of Account in SFDC, we are seeing the error "Foreign key external ID: 0000336681 not found for field ...
0
votes
0answers
61 views

Merge Duplicate Contacts

So I have Salesforce system that was implemented 6 years ago and sits ontop of a extremely old sales system. When implemented it was built in a way that it creates duplicate contacts on different ...
1
vote
1answer
77 views

Does 'upsert' process provided list by 200 records?

I have a field on Contact object that is called Test__c. It is Text(18), unique & external Id. I'm trying to upsert a list of Contacts by the Test__c field. The last Contact on the list has the ...
1
vote
1answer
242 views

Upsert causes custom and standard Duplicate Rules to fire

Could you help me understand why does my duplicate rule is firing upon insert? This is the controller: Boolean idExists = false; List < Lead > leads = [SELECT Id, Name FROM Lead WHERE Email =: ...
0
votes
1answer
183 views

User Upsert View All Data error through api

[{"message":"ViewAllData or ViewAllRecords required to upsert by standard field","errorCode":"INSUFFICIENT_ACCESS"}] I'm trying to upsert to an existing record by the ID using a PATCH call. Closest ...
2
votes
2answers
110 views

How to update existing records and upsert new records

I want to update existing task records but a new record gets created instead . What am I doing wrong. Apex: public static void Activities(List<Account> accounts) { Set<Id> persAccIds = ...
0
votes
1answer
98 views

Upsert error with apex batch job

I have a custom object named AttendanceRate with 5 fields "AttendanceRate_' + weekDay + -'__c' for each day of the week. When a user creates an activity, he has 100% of attendanceRate for this day, ...
0
votes
1answer
55 views

Insert JSON to salesforce

I have a JSON which I got from An outer System to Salesforce and I should eventually insert it to SF. { "AFTR0": [ { "AFTR1":"U", "AFTR2": "3dcda8f9213ad43aafe456ae489a158b", "...
1
vote
1answer
247 views

Upsert using encrypted field as external ID

I am looking to use an encrypted field as an external ID for the upsert function. As long as the user running the upsert has read access, the fact that it ID for the upser is encrypted shouldn't ...
1
vote
1answer
86 views

How to add Salesforce Id field for records that I am trying to update?

I am trying to update and insert (upsert) a bunch of records into Salesforce. The records are in a json file on my hard-drive. The records are inserted but if they already exist, they need me to ...
1
vote
0answers
31 views

Salesforce Upsert Differing Fields [closed]

So, I have a situation, and I am trying to decide between an upsert, and an update + insert. I am thinking it will be the latter. Is it possible to ONLY upsert values that are null within ...