Questions tagged [upsert]

All queries related to Upsert can be grouped under this Tag

Filter by
Sorted by
Tagged with
1
vote
1answer
27 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
1answer
33 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
21 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 ...
1
vote
1answer
28 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
25 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
50 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
37 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
40 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
94 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
56 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 ...
0
votes
1answer
98 views

Insert & Update (Upsert) Multiple Records of Same SObject Type in Single Transaction

I have a scenario wherein I have two custom object records of the same type, ObjectX__c. I need to update object A (which exists) with a lookup to object B (which doesn't yet exist and is being ...
1
vote
2answers
105 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 ...
0
votes
0answers
115 views

Issue upserting Account Contact Relationship - INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: AccountId

I'm upserting Account Contact Relationships the first load, works fine and we are upserting on a customer external ID field. When the upsert is run a second time - we see this error in the logs: "...
0
votes
1answer
18 views

Database.upsert - Lookup field is getting blanked, if updating an text area field of an object

We had a requirement to update a text area field of a custom object. As it was a bulk update, we use Database.upsert using an external id (happened through script already created in Mulesoft) and ...
0
votes
2answers
60 views

Cloudpage UpsertData publish problem

I am struggling with some UpsertData and i am running out of options. Hope you can see the problem. I have the following script on a CloudPage with a smartcapture form: %%[ SET @DE1 = "...
1
vote
1answer
45 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
17 views

Order Product Object Change Non Updateable Fields

I found an older question which is similar use case that I am facing HERE. I would have just commented on that thread but I do not have enough rep points. Thank you! Is there a way to change a ...
0
votes
1answer
90 views

External Id upsert

I know that with External Id, I can upsert a record and that will Insert or Update the record base on the External Id (update if exists or insert if not) instead of the regular Id. Is there is a way ...
-1
votes
1answer
71 views

on trigger upsert: if value not found in select , create a new row in different object

I am having a beastly time trying to in a trigger, check the oldmap vs new map, if a certain value exists, check for existence of a row in another object, if that row exists update, otherwise insert a ...
0
votes
1answer
121 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 ...
1
vote
2answers
193 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 = '...
1
vote
1answer
34 views

Upserting to Object from VB and getting Invalid Field does not match externalid, but it does

I have a vb.net console app that is pulling info from a database, and upserting it to a Salesforce object. Here is the error I'm getting: INVALID_FIELD: Field name provided, Product2 does not ...
0
votes
2answers
49 views

Trying to understand upsert - data loader

Im trying to understand how to use upsert.. for example there`s : ID = 1600. Type = Shipping To. and ID = 1600. Type = Billing to. Can I use upsert to update record where ID = 1600 and type = ...
1
vote
1answer
179 views

Upserting on Dynamic List in Apex [duplicate]

I am trying to upsert a dynamic list of objects into Salesforce using Apex, before point of upsert I have casted a new list to explicitly describe which object this is but I still receive the ...
3
votes
1answer
442 views

How to use upsert in REST callout JSON

"Upsert" just inserts new records from JSON, but not updates existing. It's my code: public class myClass { @future (callout = true) public static void getCallout(){ Http http = new Http(); ...
0
votes
0answers
215 views

Record with duplicate external id was inserted through bulk API upsert

I have Account with user id as external id. I have a record of Account with user id 123 created 2 months ago. I have an upsert job created through bulk API yesterday with user id as ...
0
votes
2answers
1k 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 ...
6
votes
2answers
3k views

updating a records using external Id in Apex

I copied the product data to another object named foo. I used only the name and externalId of product to copy it to Foo object. Foo's external id matches with product's external Id. Some of my ...
1
vote
0answers
286 views

Bulk API v2.0 Failed records are confused

I'm developing code in java for upload data to Salesforce. All did fine but I've a problem with failed records with bulk API 2.0 with upsert action I have the next file csv for upload data for ...
0
votes
1answer
20 views

Upsert everynow and then creates a duplicate

Every now and then I have a duplicate account been created from a piece of code that looks like the one below, where there is only 1 upsert in the whole code. I am wondering why sometimes it creates ...
0
votes
1answer
33 views

Can't upsert data with external ID's using Data Loader

Similar to this question, I am not shown the related object windows to define what object the record is related to. I have tried manually editing the mappings but it always returns the same "Field ...
0
votes
1answer
213 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....
4
votes
2answers
155 views

How can I upsert a homogeneous List<SObject>, in a good way? [duplicate]

I have some abstracted code, which at the end of some process will create a homogeneous list of SObjects. It could be a list of Accounts, it could be a list of contacts, it could be a list of some ...
0
votes
1answer
422 views

Upserting campaign members for campaigns

I have an apex class that creates campaigns based on mailings and then is supposed to add campaign members to the campaigns that were just created. The last step is done essentially by creating new ...
0
votes
1answer
151 views

Trying to turn HTTP 'POST' to 'PUT'; Desire Upsert, Not Just Insert

I originally had the following trigger and REST-callout class that functioned properly: trigger SendOpp_Trigger on Opportunity (before insert, before update) { for(Opportunity o : Trigger.new){ ...
0
votes
1answer
253 views

Duplicate records are created during upsert in Apex batch job

I need to extract records from an external application database table and Create a new table (custom object named CustomObj) in Salesforce to receive the data upload (upsert this based on the id using ...
1
vote
1answer
3k views

“INVALID CROSS REFERENCE ID” IN DATALOADER

I am trying to do upsert through data loader.It is throwing the following error for all rows in the csv file.The ids used in the csv file are correct.I got those ids from url. Please Help! ERROR: ...
1
vote
1answer
406 views

How to upsert a LookUp field via the REST API?

I have a field that's called AccountName and it's a LookUp field. When i try to update it with plain text, i get an error: id value of incorrect type, errorCode:MALFORMED_ID How can i upsert a ...
1
vote
0answers
302 views

Will not upsert on external ID (claims a MISSING_ARGUMENT)

I am upserting a list a list and it claims the external ID is missing. It is not missing as shown below. I have broken my big upsert into a for loop to track the problem. I have played around with a ...
1
vote
1answer
443 views

Marketing Cloud Preference center using AMP Script to upsert data

As we all know if we want to create a Custom Preference Center we need to use Cloud Pages HTML type page insert the HTML and AMPScript to UPSERT/update data. I have the AMP Script in place for my 3 ...
0
votes
2answers
2k views

How many records can UPSERT add or update in single request in salesforce..?

My question is if i want to insert 20,000 records and i choose to use UPSERT because it contain both insert and update. my data is going to be updated every day. is it true that UPSERT can only create ...
1
vote
0answers
306 views

Insert and/or Upsert not working

I've created two different classes, each writing to a different homebrew table and I'm not having any problem inserting in one of them, but I can't seem to get the other class to insert records into ...
0
votes
2answers
502 views

Salesforce REST upsert for externalId cause DUPLICATE_VALUE error

I send next upsert request to Salesforce: PATCH /services/data/v41.0/sobjects/Task/uuid__c/a22ac4d6-e2c0-4e53-898d-ea1d0c807775 HTTP/1.1 Host: **********.my.salesforce.com Content-Type: application/...
0
votes
1answer
2k views

Upsert failed - DUPLICATES_DETECTED

I am trying to import Contacts from external source abd im getting that error when i am inserting them into Database. The first time i insert them, there is no error, then if i try to insert them(the ...
3
votes
2answers
64 views

Can the exact type of an Apex list be checked to choose between upsert and insert/update?

I have a utility method that that works on lists of SObjects that are normally of one type: private void oneType() { Contact[] contacts = new Contact[] {}; contacts.add(new Contact(...)); ...
7
votes
2answers
7k views

Database.upsert - how to find which records have inserted/updated based on ExternalId

I am upserting list of records based on externalId as follows: List<Database.upsertResult> results = Database.upsert(lstRecords, CustomObject__c.External_Id__c,true); The results returns as ...
0
votes
1answer
109 views

How can I find out what fields made my upsert fail?

I'm trying to upsert some records. I use Database.upsert. If the failure is related to a duplicate value (external ids that have to be unique) I need to know what fields are duplicate and clear (...
0
votes
2answers
115 views

Dataloader upsert error

While I am doing an upsert operation in data loader, I am getting an error as: unable to obtain access to these records. What could be a possible reason for this?
0
votes
3answers
4k views

how to make upsert work instead of insert creating new duplicate record.?

My Object Test__c has two lookup Emp__c - 1st lookup Score__c -2nd lookup I have populated all the value. upsert (new Test__c(emp__c = 'XXXX',score__c = '123')); upsert (new Test__c(emp__c = 'XXXX'...
1
vote
1answer
317 views

fieldsToNull throwing INVALID_FIELD error

I am creating an SOAP upsert request and attempting to use the fieldsToNull tag to blank out a date field after it has already been given a value. I keep getting an INVALID_FIELD error. Bellow is the ...