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
Lisa Haigy 41Lisa Haigy 41 

How to create a case comment trigger when the case is associated with a certain contact?

We have certain contacts/accounts that submit cases to us and when a new case is created by one of these contacts, I need to have a trigger add a comment to the case relating to special handling?
AbhishekAbhishek (Salesforce Developers) 
Hi Lisa,

You can build a process on the Case object using the Process Builder (Setup --> Process Builder). 
1. Choose Case as the object and when when "Record Changes". 
2. Set the criteria using the 1) ContactId or 2) ContactId->FirstName and ContactId->Last Name
2) You can add rows to add additional contacts 
3. Choose Update Records action and select the comment field that you want to update. 
4. Activate and test the process. 

For step #2 - it depends on how are "these" contacts defined? What do they have in common?  How many are there?

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Regards,
​​​​​​​Salesforce Support.
livinkin gstonslivinkin gstons
Anything involving delete DML, platform events not tied to an sObject record, complex duplicate detection, decent error handling, roll-up data from child records which the running user doesn’t have read access on, validations on fields requiring checks on related records...
kajal guravkajal gurav
Will please answer this?
Is there any way i can display the internal comments in a field on the case page layout whilst creating a case comment in the related list.
I tried creating a custom field "internal case comments" and updating it through the workflow, but I'm unable to access the comment field on the case comment object.
PS: don't want to go for customisation