Loading

Create a report to display 'Last Case Comment'

게시 일자: Aug 29, 2024
상세 설명

It is possible to Create a Custom Report Type with Cases as the primary object and Case Comments as the secondary object and sort case comments based on their Created Date however, it's not possible to show only the latest case comment in report results.

To include only the last case comment in a report, Build a Flow to populate body of the last case comment into a custom case field in order to add it to your reports.
 
솔루션

 

Create a Custom Case Field:


1. Navigate to the Case object in Setup and create a new custom field:
 
  • Data Type: Text Area (Long)
  • Field Label: Last Case Comment
  • Length: 4,000
 
Note:
The CaseComment body field is limited to 4,000 characters.
 

2. Select your desired Field Visibility and whether you would like to apply the field to page layouts accordingly. See Create Custom Fields for more information.

 


Build a Flow:


1. Select Record-Triggered Flow

2. Select Object: Case Comment
 
  • Trigger the Flow When: A record is created
  • Optionally, set desired Condition Requirements or chose the default value of None to have the flow run each time a comment is added to the Case.
  • Optimize the Flow for: Actions and Related Records

3. Add an 'Update Records' Element to the Flow
 
  • Label: Update Last Case Comment
  • How to Find Records to Update and Set Their Values: Update records related to the case comment record that triggered the flow
  • Records Related to Case Comment: Click into the lookup field and select: $Record | Parent and then mouse click outside the lookup field. The corresponding value should be populated as: $Record > Parent ID
  • Optionally, set desired Filter Conditions or use the default value of: None--Always Update Record.
  • Set Field Values for the Case Comment Record
    • Field: Choose the custom case field you created, 'Last Case Comment'
    • Value: Click into the lookup field and select $Record | Comment Body and then mouse click outside the lookup field. The corresponding value should be populated as: $Record > Body

4. Save your flow and choose a Flow Label and lastly select to Activate. For more information see Build a Flow.


Test your flow by creating a case comment on a sample case and verify if the custom case field is populated as expected with the last case comment.

Note: The Flow will not retroactively populate the last case comment for existing cases but each time a new case comment is added after activating the flow the custom case field will be populated with the last comment moving forward.

 


Add your Custom 'Last Case Comment' field to your desired Case reports.



Please consider creating or promoting the following Ideas so that we may see this added as standard functionality with a future Salesforce release:

Report only the Most Recent Case Comment
Including Lastest Comment on Reports
Case Comments report should include Created/Last Modified Date AND Time
 
Knowledge 기사 번호

000393878

 
로드 중
Salesforce Help | Article