Questions tagged [upsert]

All queries related to Upsert can be grouped under this Tag

Filter by
Sorted by
Tagged with
-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
13 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
56 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
1answer
124 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
70 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
1answer
37 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
71 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
62 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
24 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
36 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
48 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
45 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
55 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
75 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
0answers
170 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
68 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 ...
0
votes
0answers
75 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
290 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
61 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
270 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
54 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 ...
1
vote
1answer
444 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
71 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 ...
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
56 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
74 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
234 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
165 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
101 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
93 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
233 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
84 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 ...
1
vote
0answers
367 views

Salesforce Bulkv2.0 job failed with error message: Failure writing to File store

I executed a bulk job using the Salesforce Bulkv2 API. Operation: Upsert Status: Failed State Message: Failure writing to File store I can't find information on this error and am wondering what ...
4
votes
2answers
3k views

How to use sfdx force:data:bulk:upsert on an object without an external ID?

I have a custom object (CustomObject__c) which is a child of another custom object. I want to import some records (CSV files) of CustomObject__c via SFDX (force:data:bulk:upsert). These are the ...
1
vote
1answer
266 views

access to global picklist value from apex or trigger

How can we upsert data to global picklist value by using apex? I wanna catch record data from custom object by soql in apex, and upsert the data to global picklist value. Thank you in advance.
1
vote
2answers
950 views

Upserting Person Accounts using External IDs in Contact object

I am trying to upsert a record in Salesforce using the REST API. My endpoint looks something like this https://demoaccount--dev.my.salesforce.com/services/data/v45.0/sobjects/Account/...
0
votes
0answers
155 views

Upsert Data with dataLoader using multiple keys

Is there a way to import Data with DataLoader \ Wizard using 2 keys? For example - I want to import Data (Upsert) when the unique key is actually built from 2 keys : externalId field and a ...
2
votes
1answer
491 views

How to use simple salesforce (python library for salesforce) to add ShippingAddress field?

I have tried to upsert an account with ShippingAddress using simple salesforce However, I am getting the error: [{u'errorCode': u'JSON_PARSER_ERROR', u'message': u'Cannot deserialize instance of ...
0
votes
1answer
172 views

How do I continue to upsert with a SOAP call that has lookups that can't find a record via external id?

I have a SOAP request that sets the lookup fields using the lookup object's external IDs. However, for one particular lookup, I can't guarantee that it will find a matching Salesforce record. If that'...
0
votes
0answers
474 views

Before Insert, Before Update Trigger

I have a trigger that runs on before insert and before update using trigger.new. I am sending data in batches, so the tirgger.new holds multiple records, some inserts, some updates. I also have some ...
0
votes
0answers
122 views

Opportunity Trigger with Upsert

I have an opportunity trigger that runs before insert and before update. It has a recursive check on the before update and a separate one on the before insert so that each only run once. I am pushing ...
3
votes
0answers
279 views

How to insert records into an SObject using python beatbox module?

I am looking through beatbox's github repo here https://github.com/superfell/Beatbox/blob/master/beatbox/_beatbox.py#L122 And I am not sure whether I am using it correctly, specifically I am not sure ...
1
vote
2answers
433 views

API requests calculation on a bulk upsert costing 6 calls

I am using the simple-salesforce Python package to upsert records into our Salesforce instance. I am finding that each bulk API call counts as 6 API requests. Is this correct? Is there a way to reduce ...
0
votes
1answer
307 views

testing upsert campaign members gives error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

Testing my apex controller in my dev org runs fine. However, testing the same file in another dev org gives error INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: [] Here is the controller ...