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
Chelsea LukowskiChelsea Lukowski 

Email to Case Team Member that they have been added to a case

How do you notify a case team member that they have been added to a case? I tried a workflow but it only seems to work if you update the case, not if you add a case team member. I thought about a trigger but don't know where to begin. Any help would be greatly appricieated. I am surprised this is not built in functionality. 
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Unfortunately, you can't write workflows/triggers on CaseTeamMember object. As a workaround, you can create a scheduled batch class to run periodically and send email alerts to Case Team members added since the last run.
Rakesh51Rakesh51
The best solution I've seen for this need to date:
  • Create a batch apex class that is scheduled to run as often as you need (hourly, daily, etc)
  •  This class checks the CaseTeamMember table for any new records created since the last scheduled run.
  • If there are any new records (which represent newly added team members), you can trigger an email alert to those team members via Apex code.
The downside of that approach is that it will not email newly added team members immediately - you must wait for the next scheduled run of the batch apex.