SalesforceFoundation/NPSP

Unable to use "Create Audit Fields" in NPSP Data Import

Closed this issue · 2 comments

Background

Salesforce has the ability to set system fields through the API. When migrating data from an external system, the API lets a user set a number of fields on objects that were previously read-only. By setting these fields, records will appear to have been created at the time they were originally created on your old system.

These fields are permitted additional access through the activation of this feature:

  • CreatedByID
  • CreatedDate
  • LastModifiedbyID
  • LastModifiedDate

See Salesforce knowledge article: https://help.salesforce.com/s/articleView?id=000331038&type=1

Issue Summary

If this feature is activated and an administrator configures mappings for the above fields in Advanced Mapping or Help Text Mapping they will receive an error when processing records that contain values in the fields. The error will be similar to the following: "You do not have permissions to modify Account.CreatedDate"

This functionality previously worked in NPSP Data Import but was inadvertently removed in NPSP v3.160 (August 2019) when the BDI_DataImportService class was changed to anticipate the introduction of Advanced Mapping functionality.

Steps to Replicate

  1. Enable "Create Audit Fields"
  2. Create datetime field on NPSP Data Import to store the Account created datetime
  3. In Advanced Mapping under the Account1 Object Group, create a field mapping between the field created in Step 2 and the Account Created Date field
  4. Create an NPSP Data Import record ensuring there are values in the Account1 fields including the field created in Step 2
  5. Attempt to process the NPSP Data Import record(s)
  6. Receive error: "You do not have permission to modify Account.CreatedDate"

Workaround

Do not use NPSP Data Import when a user wants to set the value of these fields upon record creation and instead use a data loading tool to directly insert the records

W-10033933

Please follow this Known Issue in the Trailblazer Community for updates.