There are times when you will need to join Salesforce objects to retrieve and present report data that meet your company’s needs. This may occur when you have custom objects or need information that is not included in the standard Report Types.
An example is wanting a report that will filter on Accounts with Orders including Product information. A custom Report Type is needed in order to query on these objects or display information stored in them.
To create the report type for this report:
- From Setup, type “Report Types” into the Quick Find
- Select Report Types from the results.
- If the Custom Report Types information page opens, click Continue.
- A list of report types will display. Click the New Custom Report Type
- Select the Primary Object from the drop down. In this example, Accounts will be chosen.
- Enter a name for the report type (e.g., Accounts with Orders including Products). Enter a description and choose which folder to store it in.
- Choose Deployed from the Deployment section.
- Click Next.
- Click the box under the Primary Object and select a Child Object that is related to it. Only related objects will be available to choose from. For this example, choose Orders.
- For each child object, select one of the following criteria:
- Each “A” record must have at least one related “B” record. Only parent records with child records are shown in the report.
- “A” records may or may not have related “B” records. Parent records are shown, whether or not they have child records.
- For this example, choose Each “A” record must have at least one related “B” record. This means only Accounts with Orders will be returned in the report.
- Click the box to relate another object. For this example, choose Order Products with “Each “B” record must have at least one related “C” record. This means only Accounts with Orders that have Products will be returned in the report.
- Click the Save The properties page displays. You can make edits to the Report Type by going to the Custom Reports Types page and clicking on the name in the list.