function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ben OBen O 

Create Trigger for Email to Salesforce

Here's the scenario: emails created from Salesforce for Outlook create tasks, but when looking at the task there's really no way to know that the origin of the task is "Email to Salesforce" and is different than a task created in the browser.  

So I created a custom checkbox field on tasks named "Email", then created the following workflow rule:

Task: Activity Origin Type EQUALS Email to Salesforce, which then marks my "Email" field as true when a new task is created from Salesforce to Email.

The problem then is that the workflow rule never fires.  Some of what I've read said that even though this is available in workflow rule, it will only fire as a trigger.  Is this true?  And if so, how would I create a trigger to accomplish this?
SonamSonam (Salesforce Developers) 
Yes, you can create a task trigger to update the email task created via E2S - code sample which you can modify to fit your requirement is available on the link below:
https://help.salesforce.com/HTViewSolution?id=000187843&language=en_US