+ Start a Discussion
Neal TalamasNeal Talamas 

Report - Find most recent record

Hello all

I'm fairly new to Salesforce & Conga but I do know my way around now. I'm wondering if someone can help me with a report I'm trying to run.

I have a custom object called Risk_Profile__c which has a lookup relationship to Contact (Contact is parent and Risk Profile is child). I created a custom report type Contacts with Risk Profiles, a contact can have multiple risk profiles.

I'm trying to run the report so that I can find all Contacts with Risk Profiles (which is no problem) but the problem I have is that I just want the most recent Risk Profile based on created date and ignore the rest. 

I don't think I can do this with the report functionality alone so I'm trying to create a formula field in the Risk Profile object as a flag that I can search on which will return a result of the most recent record (perhaps this is not the most elegant approach). It would appear I can't use SOQL queries in a Salesforce report either.

Is what I want to do possible (whether by my method or some other method) I'm not au fait with Apex at the moment, that's something I need to learn.

Any help would be greatly appreciated...

Thanks 
Jakub Kołodziej 7Jakub Kołodziej 7
There is a workaround, you can create process + flow to update checkbox on most recent risk_profile__c. Use data loader or smth to do it for already inserted records.
Your process should change checkbox on true for every new created risk_profile__c and uncheck older one for related contact. 
Then you can create report you need