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
Nelum FernandoNelum Fernando 

How to create a custom report type with 2 primary objects and one child object

Hi All,

I need to create a report that extracts values from 3 objects.

1. Contacts
2. Leads
3. Custom object created to record some activities with the above 2 objects lets call it "SActivity"

Both Contacts and Leads can have the same SActivity records.

I require a report to summarise the SActivity details. So that report should have the values from both Leads and Contacts.

My issue is that I can only create a custom report type combining either Contacts with SActivity OR Leads with SActivity.

How do I combine all 3 together ?

Any feedback is much appreciated.

Thanks





 
karthikeyan perumalkarthikeyan perumal
Hello Nelum, 

you have to relate 3 object like below.

User-added image

Hope this will help you. 
MARK BEST ANSWER if its work for you. 

Thanks
Karthik
 
Nelum FernandoNelum Fernando
Hi Karthik,
Thanks for your reply. 

I cannot get Leads under Contacts, how did you manage to do that ?
karthikeyan perumalkarthikeyan perumal
Hello Nelum, 

Make a relationship with 2 objects(Contact- Lead)  lookup relationship. but dont display the field in to lead Page layout. after this u can get the lead object under primary object of Contact. 

MARK BEST ANSWER if its work for you. 

Thanks
karthik
 
Virendra ChouhanVirendra Chouhan
Hy Nelum,

Create report type with either Contacts with SActivity OR Leads with SActivity. Lets you have created "Contacts with SActivity"
Now after clicking on save button you can see at bottom there are two buttons "Edit layout" and "preview Layout" click on edit layout button:

User-added image 

after clicking on that on right side you can see there is a link called "Add fields related via lookup" first select sActivities from the drop down.

User-added image

Now you can select Lead object and check on fields which you want in your report. (In below screenshot I have selected Account object)
User-added image

Click on Ok. Now all the fields which you have checked are able to show on report.
Nelum FernandoNelum Fernando
Hi Karthik,

I managed to get the report type by creating a look up field. But as I suspected it is not giving me my desired out come.

There are Contacts and Leads which do not have records in each other but have records in SActivity. So creating a report type for mutually inclusive data is not solving the problem. I am not expert in Salesforce, I just tried and think that's the reason. Any other idea ?