Update Records Owned by Inactive Users | SalesforceTutorial

Written by Prasanth Kumar Published on Updated on

Updating records owned by inactive users during data migration is a common challenge for Salesforce administrators. When migrating bulk data between organizations, records owned by inactive users can cause deployment failures and complicate the migration process. This guide covers the Set Audit Fields feature and Data Loader configuration needed to handle inactive user ownership during migrations.

Understanding the Inactive User Challenge

During data migration, you may encounter records owned by users who are inactive in the target organization. Standard data migration tools typically require the record owner to be an active user, which creates several problems:

  • Migration failures when inactive users don’t exist in the target org
  • Licensing costs from temporarily activating users just for migration
  • Data integrity issues when ownership must be preserved for audit purposes
  • Time delays while resolving user activation requirements

Set Audit Fields Feature for Inactive User Records

Salesforce introduced the “Set Audit Fields upon Record Creation and Update Records with Inactive Owners” feature in Winter ’16 to address these migration challenges. This organization preference allows you to:

  • Create records with inactive user ownership
  • Update existing records owned by inactive users
  • Preserve original audit field values (CreatedBy, CreatedDate, LastModifiedBy, LastModifiedDate)
  • Maintain data integrity during large-scale migrations

Enabling Set Audit Fields

To enable this feature in your Salesforce org:

  1. Navigate to Setup → Company Settings → Company Information
  2. Click Edit
  3. Check “Set Audit Fields upon Record Creation and Update Records with Inactive Owners”
  4. Save the changes

Important: This setting requires the “Set Audit Fields upon Record Creation” user permission for the migrating user account.

Data Loader Configuration for Inactive User Records

When an administrator is planning to use Data Loader to mass import new records to a custom object from a new API, several configuration steps are required to handle inactive user ownership:

Prerequisites for Data Loader Setup

  • Set Audit Fields feature enabled in the target organization
  • User account with “Set Audit Fields upon Record Creation” permission
  • Valid user IDs for inactive users in the CSV file
  • Custom object with appropriate field-level security configured

Data Loader Configuration Steps

  1. Enable Set Audit Fields in Data Loader:
    • Open Data Loader
    • Go to Settings → Settings
    • Check “Use Bulk API” if processing large volumes
    • Check “Set Audit Fields” option
  2. Prepare CSV Data:
    • Include OwnerId column with inactive user IDs
    • Include CreatedById and LastModifiedById if preserving audit trail
    • Include CreatedDate and LastModifiedDate in ISO format (YYYY-MM-DDTHH:MM:SS.sssZ)
  3. Field Mapping:
    • Map OwnerId to the inactive user ID field
    • Map audit fields (CreatedBy, CreatedDate, etc.) if preserving original values
    • Ensure all required fields are mapped correctly

Best Practices for Migrating Records with Inactive Owners

User Management Strategy

  • Create inactive users in the target org before migration if they don’t exist
  • Use consistent User.Username values between source and target orgs
  • Document the business justification for preserving inactive ownership
  • Consider data retention policies for inactive user records

Performance Considerations

  • Use Bulk API for large data volumes (>10,000 records)
  • Process records in batches to avoid timeout issues
  • Monitor API limits during migration
  • Test with a small subset before full migration

Security and Compliance

  • Verify field-level security allows inactive user record access
  • Review sharing rules that may affect inactive user records
  • Ensure compliance with data retention requirements
  • Document audit trail preservation for regulatory purposes

Troubleshooting Common Issues

Migration Failures

If Data Loader fails when processing inactive user records:

  • Verify Set Audit Fields is enabled in both Data Loader and org settings
  • Check that the migrating user has required permissions
  • Validate inactive user IDs exist in the target organization
  • Review field-level security for all mapped fields

Ownership Validation

After migration, validate record ownership:

  • Query records to confirm OwnerId values are preserved
  • Check audit fields maintain original timestamps
  • Verify sharing rules work correctly with inactive owners
  • Test record access for active users who need to work with the data

Alternative Approaches

Temporary User Activation

If Set Audit Fields is not available, consider:

  • Temporarily activating users during migration
  • Using a dedicated migration user as temporary owner
  • Implementing post-migration ownership updates

Data Transformation

For complex scenarios:

  • Transform ownership to active users during migration
  • Maintain original owner information in custom fields
  • Use workflow rules to handle ownership changes

Frequently Asked Questions

Can I update records owned by inactive users without the Set Audit Fields feature?

No, standard Salesforce functionality prevents creating or updating records with inactive user ownership. The Set Audit Fields feature is required to bypass this restriction during data migration.

What permissions are needed to use Data Loader with inactive user records?

The migrating user account needs the “Set Audit Fields upon Record Creation” permission, along with standard Data Loader permissions like “API Enabled” and appropriate object-level permissions for the target objects.

How do I handle sharing rules for records owned by inactive users?

Records owned by inactive users follow the same sharing rules as active user records. However, the inactive owner cannot access the records. Consider using sharing rules or manual sharing to grant access to active users who need to work with the data.

Can I preserve original audit field values when migrating records?

Yes, when Set Audit Fields is enabled, you can specify CreatedBy, CreatedDate, LastModifiedBy, and LastModifiedDate values in your migration data. Data Loader will preserve these original audit trail values instead of setting them to the current user and timestamp.

What happens to workflow rules and triggers for records owned by inactive users?

Workflow rules and triggers execute normally for records owned by inactive users. However, any actions that require the owner to be active (like sending emails from the owner) may fail. Review your automation logic to handle inactive ownership scenarios.