Questions tagged [upsert]

All queries related to Upsert can be grouped under this Tag

Filter by
Sorted by
Tagged with
0
votes
1answer
319 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
806 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
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 ...
0
votes
1answer
90 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
421 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
96 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
36 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
1k 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
471 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
396 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
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 = '...
1
vote
1answer
67 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
249 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
695 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 ...
4
votes
1answer
1k 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(); ...
1
vote
0answers
454 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 ...
1
vote
2answers
6k 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 ...
8
votes
2answers
15k 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
539 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
23 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
49 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
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....
4
votes
2answers
386 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
1k 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
547 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
729 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
10k 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: ...
2
votes
1answer
1k 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
556 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
707 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
7k 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
679 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
1k 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/...
1
vote
1answer
5k 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
66 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(...)); ...
12
votes
2answers
19k 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
176 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
174 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
10k 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
700 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 ...
0
votes
1answer
318 views

UpsertResult isCreated is not working

I am having issues with Upserting data. Here is my code: global static void MyMethod(string param1, string objName, string param2) { CustomObject__c record = new CustomObject__c(); record....
1
vote
0answers
18 views

Api Upsert by one of two admins overwrites the other admin's record instead of creating a duplicate

I have an org with two admins: AdminA and AdminB. AdminA upserts a record with an external ID - this creates a new record AdminB upserts the same record with the same external ID. I would expect ...
1
vote
1answer
618 views

Issue with External Id while upserting from external system using Salesforce SOAP API

We are facing some issue during upsert, please find details below: We have following objects: and sample data for the above objects: The external system is trying to upsert TankRead__c with the ...
0
votes
1answer
195 views

Does Insert happen for new records if I perform upsert on partial/full sandbox using Salesforce Id (instead of external id) from source?

Suppose I have records exported from source which includes records which are already in partial sandbox (Salesfoce Ids will be same for such records in source and partial sandbox) and some new records ...
1
vote
2answers
1k views

updating the child record and linking it to parent

I have scnerio where I am loading the child record from an external system and I want to connect it with the parent record. But I do not have the sfdc id of the parent record that I can put in the ...
0
votes
1answer
687 views

Update not working for Visual Force Page fields

I am writing a class to update a record with data from visual force page if it exists in contact, if it does not it will insert a row.I am using Update and Insert statements for this purpose.Looks ...
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....
0
votes
1answer
501 views

Pre-populate text field in cloudpages form, if left at same value, use that

I've set up a form in Marketing Cloud. It pre-populates the fields from a data extension with people's details, opening the form with http://web.form.com/updatepref?PID=pidgoeshere It populates ...
3
votes
2answers
502 views

PHP Toolkit 20.0 (Enterprise) Upsert/Update Custom Object - deserializer not found

I'm using PHP Toolkit 20.0 (Enterprise) and the latest WSDL. Partner also fails for me. I can successfully create (using PHP Toolkit create) objects of this type. All my attempts to Update or Upsert ...
3
votes
1answer
1k views

INVALID_CROSS_REFERENCE_KEY, invalid cross reference id

I am trying to upsert the list below: OpportunityLineItem:{ Id=00k11000007NorcAAC, ServiceDate=2014-03-30 00:00:00, UnitPrice=200, Quantity=1, ProposalID__c=1, Status__c=IN_APPROVAL, ...