---
schema_version: "1"
id: 927d4c62a0e10c3fe1c5d55c8a0f58842b3e2b1bd9494f688f1640a3918f7e65
title: Add Apex Triggers to Idea Comments
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/ideas_comments_triggers.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.ideas_comments_triggers.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 554aafd03daa79420d7be2bc10b619859b161a3bbf74876301a7c048f4570e6c
description: Adding Apex triggers to Idea Comments lets you perform actions related to comments that users post to an idea.
products:
  - Service Cloud
release: "264"
---
# Add Apex Triggers to Idea Comments

Adding Apex triggers to Idea Comments lets you perform actions related to comments that users post to an idea.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.legacy_editions.htm&amp;language=en_US" target="_blank">View supported editions</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
      <colgroup>
        <col style="width:50%">
        <col style="width:50%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d31019e54">User Permissions
            Needed</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d31019e54 ">To define Apex triggers:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d31019e54 ">Author Apex</td>

        </tr>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d31019e54 ">To manage Ideas communities: </td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d31019e54 ">Customize Application</td>

        </tr>
      </tbody>
    </table>

A trigger is a set of Apex code that fires at a particular time in the lifecycle of a record. To better manage ideas in your Ideas community, you can add Apex triggers to idea comments.

Use triggers on comments to perform actions such as:

- Sending an email notification to the moderator or other user when a comment is left on an idea.
- Sending an email notification to the user with the contents of their comment.
- Notifying the moderator when a specified number of comments is reached for an idea.
- Preventing posting of comments with specific words.