Loading

Considerations and Activation of "Create Audit Fields" in Salesforce

Date de publication: Apr 12, 2025
Description

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

Since these fields are intended to be Audit Fields, they can only be set on create and not update. If the records already exist in Salesforce, they need to be exported to a .csv file, deleted in Salesforce, and then imported with the updated information as new records. 

In general, Salesforce recommends that this feature be enabled only while doing data migration. In certain cases, such as routinely copying new data from an external system to Salesforce, this can be enabled permanently. This feature must be enabled by a System Administrator in the organization. 

Notes:

  • The "Create Audit Fields" feature is generally available.  See this Salesforce Support video for more information.
  • This feature does not permit ‌values to be updated, only inserted (this only works for insert, not upsert).
  • The 'LastModifiedDate' and the 'LastModifiedBy' fields will not reflect the inserted value if the Task is associated with a Contact or Lead (WhoID); or other records such as Account, Opportunity, Campaign, and so on (WhatID); during Task Insert.
  • Permission required to set 'audit' fields: Modify All Data.
  • When “Enhanced Email” is enabled and EmailMessages are inserted, the associated Task records that get auto-created will not use the CreatedDate of the EmailMessage, but instead will have a CreatedDate of the date of insertion.
Résolution

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

  • CreatedByID
  • CreatedDate
  • LastModifiedbyID
  • LastModifiedDate

 

These conversion-related Lead object fields can also be defined on Insert:

  • IsConverted
  • ConvertedDate
  • ConvertedAccountId
  • ConvertedContactId
  • ConvertedOpportunityId

 

These are the objects that you can set these fields on:

  • Account
  • CampaignMember
  • CareService
  • Case
  • CaseComment
  • CodeSet
  • Contact
  • ContentNote
  • ContentVersion
  • Contracts
  • EmailMessage
  • FeedComment
  • FeedItem
  • FinancialGoal
  • FinancialPlan
  • HealthCondition
  • Idea
  • IdeaComment
  • Lead
  • Opportunity
  • Quote
  • Vote
  • Work Order
  • Task
  • Event
  • Attachment
  • All custom objects

Note: Set Audit Fields are also supported for Health Cloud and Financial Cloud Managed Package Objects. A few examples from the Health Cloud objects are CodeSet, HealthCondition, CareService and from Financial Cloud are objects like FinancialPlan, FinancialGoal, etc.

Numéro d’article de la base de connaissances

000386065

 
Chargement
Salesforce Help | Article