Loading

Error 'INVALID_FIELD_FOR_INSERT_UPDATE: Attempting to update parent field as part of an upsert'

Udgivelsesdato: Oct 13, 2022
Beskrivelse
You may encounter an error when you attempt to insert, update, or upsert records with an API tool such as Data Loader. Error: 
  • "INVALID_FIELD_FOR_INSERT_UPDATE: Attempting to update (as part of an upsert) parent field"
This error occurs when at least one value in the CSV file has been mapped to a parent field or a parent record created through relationships.

See also: 
Løsning

Cause 1: Updating related record fields

Check the CSV file and mapping (Data Loader SDL file) for the mapped fields. If any fields attempt to update another object through the relationship field, this may be the problem.

Example:

  • Contact.FirstNameLocal =Ok!
  • Contact.Accountid = Ok!
  • !Contact.Account.AccountName = BAD
The resolution for this problem will be to try and update the parent object in a separate import, update, or upsert. 


Cause 2: Changing the master in a master-detail relationship

By default, records can’t be reparented in master-detail relationships. Attempts to change the parent record will result in the above error message. 

If the relationship is set up on a custom object, Administrators can allow child records to be reparented by selecting the "Allow reparenting" option in the master-detail field properties. 

In order to enable "Allow reparenting" in Lightning:

  • From Setup, go to Object Manager | Custom Object.
  • On the sidebar, click Fields & Relationships.
  • Click New.
  • Choose Master-Detail Relationship and click Next.
  • On Step 3, check "Allow reparenting".
In order to enable "Allow reparenting" in classic:
  • From Setup, go to Create | Objects
  • Choose Custom Object, click New button on Custom Fields & Relationships section
  • Choose Master-Detail Relationship and click Next.
  • On Step 3, check "Allow reparenting".
Vidensartikelnummer

000385552

 
Indlæser
Salesforce Help | Article