Find your content:

Search form

You are here

How can I get an Account's contact email based on another custom object?

 
Share

I have a custom object called: license, with a Lookup relation to Account. Based on some filters I do for the account, I want to get a list of licenses, as well as a list of email (or contact info)

  • the regular report objects do not give me such an option
  • joined reports can not help me here
  • I want to try and avoid from using several different reports, and join with 3rd party.

thanks


Attribution to: Saariko

Possible Suggestion/Solution #1

You have to go for VF pages as you can't query the child object's data from a parent object through the reports.. A custom related list developed thru vf pages will help you here probably


Attribution to: Sathya

Possible Suggestion/Solution #2

If you can change the relationship on License from Lookup to Master-Detail, you may be able to rollup your filter conditions to a Rollup Summary Field on Account, and then use that summary field to do your filtering. This depends on what your filters on License are specifically.

For example, if you want to only show Accounts where there is at least one License with Active__c = TRUE, you can use a Number formula field on License: IF(Active__c == TRUE,1,0). Then create a Roll-up Summary Field (called "Total Active Licenses" maybe) on Account that shows you SUM(Active__c) from Licenses. This field now identifies how many Licenses on your Account are Active. Your report will then filter on showing Accounts where Total Active Licenses > 0.

If there is a reason this relationship cannot be Master-Detail, then this functionality can only be accomplished through an Apex Trigger.


Attribution to: Jeremy Nottingham
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/929

My Block Status

My Block Content