2

I am attempting to migrate a custom setting record from one sandbox org to another. I have successfully exported the custom setting record (~150 fields) from org1 to a .csv file. When importing into org 2, I am able to map all of the fields as expected. However, when running the import I have receiving the following error:

FIELD_INTEGRITY_EXCEPTION:field integrity exception: SetupOwnerId (id value of incorrect type):SetupOwnerId --

I have used both dataloader.io and the Data Import Wizard from the Salesforce Setup menu - in both situations I am received the same error. I have also tried both inserting and upserting (created the custom setting record but left all of its fields blank) - in both situations I am received the same error. I have also tried adding a SetupOwnerId column to the .csv file but there does not appear to be a field to map this to. The custom setting itself is public, a List type and is not a part of a managed package.

Has anyone encountered this issue or know of a way to avoid this?

  • Are your custom settings set to private? Generally speaking, I don't believe custom settings can't be imported via data loader. I know they can be set via post install scripts or inserted using code. While they "mimic" custom objects, they're typically not accessible in quite the same way. Your error message is saying your owner isn't of the correct type. – crmprogdev May 31 '16 at 15:38
  • No, the custom settings are set to public in both orgs. You stated "I don't believe custom settings can't be imported via data loader." - do you mean that custom settings can not be imported using data loader? – John_Henry May 31 '16 at 15:52
  • Custom settings doesn't have owner.... so i dont understand how you can get a such error... do you have custom object with same name as custom setting? @John_Yankee – Klodj_Tema May 31 '16 at 16:01
  • @John_Yankee Yes, that was a typo on my part. For some reason, I seem to recall that one cannot import them via dataloader. It sticks in my mind they need to be entered either manually or programmatically. I'll look to see if I can find a reference to cite. – crmprogdev May 31 '16 at 16:19
  • @Klodj_Tema No, I do not have a custom object with the same name as the custom setting. Per crmprogdev it seems like maybe this is not possible. – John_Henry May 31 '16 at 16:25
2

I think these two references from Salesforce Help on Custom Settings provide the back up for my comments. One of them is as follows:

If you're thinking of using List Custom Settings, consider using Custom Metadata Types instead. Unlike with List Custom Settings, you can migrate the records of Custom Metadata Types using Packages or Metadata API tools.

Which implies that you can't migrate List Custom Settings which of course is true.

Additionally, and I believe this is the clincher:

Only custom settings definitions are included in packages, not data. If you need to include data, you must populate the custom settings using a standard Apex or API script run by the subscribing organization after they have installed the package.

The above would seem to apply to production orgs as well as packages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.