Mastering Historical Data Import in Salesforce: Importing Audit Fields

Sam Hoult
November 19, 2023
Whether it’s for compliance, audit, or data accuracy reasons, in this guide we will run you through the steps to enable Create Audit Fields in Salesforce and migrate historical data.

Historical data import into Salesforce isn't just about transferring information; it's about maintaining accuracy and integrity in crucial fields. Before initiating this process, it's vital to ensure your Salesforce setup aligns with the data importing requirements. Whether it’s for compliance, audit, or data accuracy reasons, in this guide we will run you through the steps to enable Create Audit Fields in Salesforce and migrate historical data.

Preparation: Setting Up Salesforce

Enable 'Create Audit Fields'

Before beginning your historical import you will first need to ensure that you have enabled the ‘Create Audit Fields’ setting.

  1. Navigate to Setup and enter 'User' in the Quick Find box.
  2. Select 'User Interface' from the options.
  3. Check the boxes for 'Enable "Set Audit Fields upon Record Creation"' and 'Update Records with Inactive Owners' under User Permissions.
  4. Save your changes by clicking 'Save'.

Creating a Permission Set:

Navigate to:

Salesforce Classic: Go to Setup > Manage Users > Permission Sets

Lightning Experience: Click the Gear icon > Setup > Users > Permission Sets

  1. Click on 'New'.
  2. Input Permission Set details like 'Label' and 'Description'.
  3. Optionally, specify a 'User license' to limit this Permission Set to Users with specific licenses.
  4. Save your changes.
  5. On the following page, access System Permissions.
  6. Click on 'Edit'.
  7. Locate 'Set Audit Fields upon Record Creation' and check the corresponding box. Note: If you don't see this option, it's likely that 'Set Audit Fields upon Record Creation' and 'Update Records with Inactive Owners' aren't currently enabled.
  8. Save your changes.

Assigning the Permission Set:

Go to:

Salesforce Classic: Setup > Manage Users > Permission Sets

Lightning Experience: Click the Gear icon > Setup > Users > Permission Sets

  1. Choose the Permission Set related to 'Audit Fields'.
  2. Click on 'Manage Assignments'.
  3. Select 'Add Assignments'.
  4. Choose the User you want to assign the 'Permission Set' to.
  5. Click on 'Assign'.
  6. Complete the process by clicking 'Done'.

Import your Data

Remember to always have a backup and rollback strategy in place. Using a tool like Dataimporter.io ensures you that will be able to one-click rollback the records which you are importing.

Formatting

Ensure that your data is formatted correctly for these fields. 'Created By' often corresponds to a user's ID, while 'Created Date' and 'Last Modified Date' require a specific date-time format aligned with Salesforce standards.

Map your fields

When mapping your fields, make sure you remember to map the Audit fields you wish to populate, and remember that these values can only be set on a record Creation, not Update. Where you are referencing CreatedBy or LastModifiedBy and you don’t have a Salesforce User Id value available, you can make use of Dataimporter’s lookup relationships to populate those values for you automatically.

Running the Import

To prevent dirty data from entering your Salesforce Org, use a subset or sample of Data to test your mapping and formatting. Validate the results of this subset before processing the remaining data. Check that the audit fields were set correctly, and any lookups you used found the correct user records.

Summary

By paying attention to these specific details while importing audit fields, you can ensure the accurate representation of historical data within Salesforce, enabling better tracking and analysis of records. Want to use a tool which has Rollback, Formatting, and Sampling built into it? Give Dataimporter a try and see why it is the Data Loading tool of choice for Salesforce Professionals.

Get Started with Dataimporter