Newer Version Available
Entity and Field Considerations in Triggers
QuestionDataCategorySelection Entity Not Available in After Insert Triggers
1QuestionDataCategorySelection[] dcList =
2 [select Id,DataCategoryName from QuestionDataCategorySelection where ParentId IN :questions];Fields Not Updateable in Before Triggers
- Task.isClosed
- Opportunity.amount*
- Opportunity.ForecastCategory
- Opportunity.isWon
- Opportunity.isClosed
- Contract.activatedDate
- Contract.activatedById
- Case.isClosed
- Solution.isReviewed
- Id (for all records)**
- createdDate (for all records)**
- lastUpdated (for all records)
- Event.WhoId (when Shared Activities is enabled)
- Task.WhoId (when Shared Activities is enabled)
* When Opportunity has no lineitems, Amount can be modified by a before trigger.
** Id and createdDate can be detected in before update triggers, but cannot be modified.
Fields Not Updateable in After Triggers
The following fields can’t be updated by after insert or after update triggers.
- Event.WhoId
- Task.WhoId
Considerations for Event DateTime Fields in Insert and Update Triggers
We recommend using the following date and time fields to create or update events.
- When creating or updating a timed Event, use ActivityDateTime to avoid issues with inconsistent date and time values.
- When creating or updating an all-day Event, use ActivityDate to avoid issues with inconsistent date and time values.
- We recommend that you use DurationInMinutes because it works with all updates and creates for Events.
Operations Not Supported in Insert and Update Triggers
The following operations aren’t supported in insert and update triggers.
- Manipulating an activity relation through the TaskRelation or EventRelation object, if Shared Activities is enabled
- Manipulating an invitee relation on a group event through the Invitee object, whether or not Shared Activities is enabled
Entities Not Supported in After Undelete Triggers
- CollaborationGroup
- CollaborationGroupMember
- FeedItem
- FeedComment
Considerations for Update Triggers
Field history tracking honors the permissions of the current user. If the current user doesn’t have permission to directly edit an object or field, but the user activates a trigger that changes an object or field with history tracking enabled, no history of the change is recorded.
Considerations for the Salesforce Side Panel for Salesforce for Outlook
When an email is associated to a record using the Salesforce Side Panel for Salesforce for Outlook, the email associations are represented in the WhoId or WhatId fields on a task record. Associations are completed after the task is created, so the Task.WhoId and Task.WhatId fields aren’t immediately available in before or after Task triggers for insert and update events, and their values are initially null. The WhoId and WhatId fields are set on the saved task record in a subsequent operation, however, so their values can be retrieved later.