First Custom Report Type Creation
Jul 25, 2007Custom Report Types
The first step to using the new reporting features in Summer'07 is to create a Custom Report Type. I'm going to show you how to create a simple one and bring in extra fields.
Custom Report Types are really useful if you want to expose new fields to users - for instance, to report on the Owner's Division in a report on Opportunities, or to report on a hierarchy of Custom Objects. You can also simplify the Report Wizard for your users by removing fields that they don't care about from the list in the report wizard.
If you are building the Custom Report Types based on a set of different objects, the main four objects that are related as master-detail or through lookups will be queried using Inner Joins. You can find out more about join types in the article from May: Types of Joins - a Primer .
Custom Report Types let you create the view that users will see in the end user report wizard. When users see all the choices of Report Type in the report wizard, they will also see the new types you can create.
The setup tree
First step is to login as an administrator. You'll probably want to start with this, but an as administrator of your salesforce.com account (somebody with "modify users", "modify all data", and "modify billing") you can decide to let other users access the Custom Report Types by setting the permission on their profile. If you've signed up for pre-release, you'll be the administrator, and you can do what you'd like with the data and objects in the Organization you've created. You can sign up by going to the prerelease homepage.
Once you've started, go to the setup, and in the setup tree you'll see the entry for Custom Report Types:
once we're in the Custom Reports Types section (and after a splash page if it's your first visit), you'll see the list of Custom Report Types:
Creating the Custom Report Type
After clicking "New Custom Report Type", we get a page to choose what kind of report type this is going to be:
The Primary Object choice is the first object in the list of objects in the Custom Report Type.
The other objects chosen can either be:
- objects that would be a related list (or related list of an objects that's a related list)
- objects that are detail to this object's master
- objects that are chosen in a lookup field in this object, or one of it's related lists
So if you are going to report on Accounts and their contacts, we'll choose Accounts here.
The Report Type Name is the name that users will see in the Report Wizard (as shown at the top of this page). Users expect to see things like "Accounts with Opportunities". You can name your report type something different if it's important to your business. In salesforce, we might have one with "AppExchange applications with trials"
The description will appear to the right of the choice of Report Type by the end user. This is mandatory, because usually the report type name alone will not tell the end user what kind of report and what data they will get. On a report with Accounts and Contacts in it, the description might be:
This Report Type will show the list of accounts that have contacts, and for each of the accounts, the list of contacts in that account.
The Category is the kind of objects that are involved in the reports. You can't edit this list yet, but you can choose any of the standard report type categories, for instance to put your report type based on Accounts in the Accounts category.
You can then choose if end users will be able to see the Report Type in their report wizard. If you choose "In Development", only users with the "Manage Custom Report Types" will be able to see it.
You should choose "Deployed" unless you are scared somebody will come to your cubicle and tell you off and take your stapler.
You can then click next, after your page looks like this:
Choosing the objects and records returned
Now you should have a page a lot like this:
- Where is Owner?
- Where is User?
- Where is "Parent Account"?
All of the choices here are either:
- detail objects, where Account is the Master
- objects that have a lookup to the Account object
I can choose Contacts though - because it's a detail. So I choose Contacts, and hit save, and now I have:
Adding fields from lookup objects:
Fields from lookup objects can be added in next. For example, these are fields from:
- Account Owner
- Account Owner Role
- Account Owner Reports To Role
- Creator
- Parent Account
Click "Edit Layout", and you'll get a page that looks a lot like the "Page Layout" editor for an object or record type:
I click "Add fields related via lookup"
and I can see the list of lookups available in Account. If I'd wanted the lookups from the Contact object, I'd choose "Contact Fields" in the drop-down, and then click the link, to get the lookup list:
and we can choose the Owner by clicking on it, and see the list of fields:
I can choose the ones I want, then after clicking OK, I can see the fields appearing in the Account section on the page layout:
These are visible as lookup fields by the small magnifying glass icon. If you place your mouse cursor over the tile, you will see where they have come from:
Now we can hit save, and head to the Reports tab, and "Create a New Report" to admire our handiwork.
Next week, I'll look at some simple CRTs that are useful that you can create. After that, we'll look at some ludicrously complicated ones that only serve to show that where there's a will, there's often a way

0 Comments