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
wsuycottwsuycott 

Inserting tasks via upload, want to sent emails as well

We have a linked SQL server to Salesforce via dbAmp (but could also be from excel connector or other external API load tools) and are uploading tasks for Salesforce users.  What we would like is a method to also to perform the function "Send Notification Email" as the UI allows you to do. There doesn't seem to be a method for having this functionality, and unfortunately you can't have a workflow pickup a task to send an email. 

 

Is there a means of having that functionality kick of an email the same way it does from the interactive UI, or perhaps a secondary load into the EmailMessage object to accomplish the same thing, or is an APEX trigger the only means of accomplishing this?

Best Answer chosen by Admin (Salesforce Developers) 
forceAMPforceAMP

DBAmp does have the ability to add the needed headers.  Please contact forceAmp.com support for more information on how to turn on these options.

 

Thanks,

 

Bill Emerson

All Answers

aalbertaalbert
When using the API, you need to set an additional SOAP Header to invoke the email notifications. More info here
wsuycottwsuycott

Other than API is there a means of triggering the task to send out the notification email to the ownerid of the task?  The linked database we are using only inserts records and doesn't have a means of effecting soap header changes (the package is dbAmp that links an SQL server to the SFDC with API calls).  In our case we are inserting between 1 and "n" number of tasks that we would like to have the notification email sent from it. 

 

While we have effected a workaround solution (see next section) it is not as functional as we would like (i.e. send the link to the task created to the user).

 

Workaround: Tthrough an APEX bulk process trigger on the insert event that tests for whether a hidden field (not present on the UI) is set and if so the trigger will create an outbound MASS email that uses a template.  The problem is that the MASS email doesn't allow for associating task objects (or any activity object) with the mass email, and therefore we can't pass variables into the email template.  The the email template that is present today can only send fixed information to the user notifying them that a task has been created (but without the link to the actual task).  Although we can accomodate multiple different templates, each template is a fixed-text only communication without the benefit of including links to the created task.

 

Any other means of creating the task - email notification of user action?

forceAMPforceAMP

DBAmp does have the ability to add the needed headers.  Please contact forceAmp.com support for more information on how to turn on these options.

 

Thanks,

 

Bill Emerson

This was selected as the best answer