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
ChristiaanChristiaan 

Custom object where only the last record per account is shown in a report

I have implemented a custom object Customer Satisfaction research that is a related list of accounts. In this object the results of the satisfaction interviews are stored. 

 

In a year multiple customer satisfaction researches can be conducted for multiple accounts. For an example see below:

 

Account A:

 

record 1 of customer satisfaction research - research 1

record 2 of customer satisfaction research - research 2

record 3 of customer satisfaction research - research 3

 

Account B: 

 

Record 1 of customer satisfaction research - research 1

Record 2 of customer satisfaction research - research 2

 

Account C:

 

Record 1 of customer satisfaction research - research 1

 

In a report i want only the last research per account to be shown, so following the example:

 

Record 3 of Account A

Record 2 of Account B

Record 1 of Account C

 

Is there way (or in the object, or in the criteria of the report) to make sure that only the last record per account is shown in a report? 

 

Salesforce premier support couldn't figure out a way to do it, so i hope someone on the discussion board can help me.

 

With kind regards,

 

Christiaan Veldkamp  

 

 

 

Richie DRichie D

Hi,

 

There may be other ways to do this but off the top of my head you could:-

 

 

  1. Create a new object to hold the report values matching the fields from your original object that you want in the report.
  2. Create a trigger on your original object to populate your 'report object' matching on your Account ID. If one already exists overwrite it; if not then insert new one.
  3. Run report against new report object and you'll have 1 entry per account.
There maybe a way to do it in the report wizard but I've found that implementing my own 'report friendly' objects much quicker and simplifies reports no end.
  
 
Good luck.
R.