ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Service Cloud questions11 of 100
Service CloudMedium 2 min read

How do automated case comment notifications maintain communication transparency with customers?

Answer

Basics: CaseComment records are the classic notes on a case. A comment has IsPublished: public comments are visible to customers in portals and Experience Cloud, private ones are internal. In Lightning Case Feed, agents more often use emails and posts, but comments still matter for portal communication and integrations.

How it works: Out of the box, Support Settings (Setup > Support Settings) include options to notify the case contact or owner about changes; names vary by release, so verify the current options. For anything beyond that, build automation: a record-triggered flow (or Apex trigger) on CaseComment, entry criteria IsPublished = true, then send an email using an email template to the Case Contact. For internal stakeholders, add the case owner, team members or Slack. The email template can use the case comments merge field, and the email is logged as an activity.

Advanced / deep dive: Decide between comments, emails and feed posts: emails are threaded with Email-to-Case using the Thread ID reference and reply handling, comments are simple and portal-friendly. Use Enhanced Email and an org-wide email address so replies route back to the case. Single email limits are 5,000 external recipients per day per org (Enterprise); a chatty trigger can consume it. Mind loops: an auto-reply to a comment that creates another comment can recurse. Apply sharing: portal users see only public comments on cases they can access. Experience Cloud has its own in-app and email notification settings for users.

Code / config example:

apex
trigger CaseCommentTrigger on CaseComment (after insert) {
    List<Id> caseIds = new List<Id>();
    for (CaseComment cc : Trigger.new) {
        if (cc.IsPublished) caseIds.add(cc.ParentId);
    }
    if (!caseIds.isEmpty()) {
        CaseCommentNotifier.notify(caseIds); // bulk handler: query cases, send emails once per transaction
    }
}

Hidden gotchas & must-remember points:

  • CaseComment body is limited to 4,000 characters.
  • Unpublished comments never reach the customer, even if a notification fires.
  • Customers without an email on the Contact get nothing; silent failure.
  • Daily email limits apply to workflow-free automation too.
  • Workflow Rules and Process Builder are retired; use Flow.
  • Comments cannot be edited by customers and are not threaded replies.

Best practice: Notify only on published comments, use a template with a clear case reference, and log every notification for auditability.

Service CloudCase CommentsNotifications
Practice SOQL & Apex
PreviousHow do Omni-Channel Supervisor wallboards assist supervisors in tracking real-time contact center performance?Next How do Omni-Channel capacity models prevent agent burnout by balancing simultaneous multi-channel workloads?

More Service Cloud questions

  • What role do asynchronous Apex and batch jobs play in handling heavy background processing for support operations?
  • What data governance practices ensure long-term database hygiene across enterprise Service Cloud environments?
  • How does entitlement process versioning manage rule updates for active customer support contracts?
  • How do real-time supervisor alerts assist contact center managers in mitigating queue bottlenecks?
  • How do Knowledge feedback analytics help authors identify articles that require content revision?