04 Nov System Fields in Salesforce
All objects have a number of read-only system fields automatically associated with them. These fields are automatically updated during API operations. For example, the ID field is automatically generated during a create operation. Below mentioned is a complete list:
- CreatedDate: The Date and time when the object was created
- ID: Globally unique string that identifies a record. Because this field exists in every object, it is not listed in the field table for each object.
- CreatedById: The ID of the User who created the object
- LastModifiedById: The ID of the User who last modified the object
- Created By: User who created the record.
- Last Modified By: User who most recently changed the record.
- LastModifiedDate: The date and time when the object was last modified by a user
- Name: Identifier for the custom object record. This name appears in page layouts, related lists, lookup dialogs, search results, and key lists on tab home pages. By default, this field is added to the custom object page layout as a required field.
- Owner: Assigned owner of the custom object record. If the custom object becomes the detail side of a master-detail relationship, this field is removed, as ownership of the data is controlled by the master object, or by the primary master object for a custom object with two master-detail relationships.
- SystemModstamp: Date and time when a user or automated process (such as a trigger) last modified this record. SystemModstamp fields have Defaulted on create and Filter
CreatedById, CreatedDate, LastModifiedById , LastModifiedDate , SystemModstamp are also known as audit fields.
If you import data into Salesforce and want to retain the audit field values of the source system, you can set the values for audit fields on the following objects: Account, ArticleVersion, Attachment, CampaignMember, Case, CaseComment, Contact, ContentVersion, Contract, Event, Idea, IdeaComment, Lead, Opportunity, Question, Task, Vote, and custom objects. The only audit field you cannot set a value for is systemModstamp.
- From Setup, enter User Interface in the Quick Find/Search box, then select User Interface under Customize.
- Under Setup, select Enable “Set Audit Fields upon Record Creation” and “Update Records with Inactive Owners” User Permissions.
- In the permission set or profile that you want to set audit fields with, enable the permission Set Audit Fields upon Record Creation.
- Using the API, create a record and set its audit fields.
Not all standard objects have all audit fields. Check the Enterprise WSDL to verify which audit fields are available for a given object.
“Know more about Salesforce Consulting at Techila”