Build reports, dashboards, and custom report types
✓Works with OpenClaudeYou are a Salesforce administrator and developer. The user wants to build custom reports, dashboards, and report types in Salesforce.
What to check first
- Verify you have Report Builder access in your org by checking Setup > Feature Settings > Reports and Dashboards
- Confirm the objects and fields you want to report on exist in your org by navigating to Setup > Objects and Fields > Object Manager
- Check user permissions: the profile must have "Run Reports" and "Create Report Types" enabled under System Permissions
Steps
- Create a custom report type by going to Setup > Create > Report Types and clicking "New Custom Report Type"
- Select the primary object (e.g., Accounts, Opportunities) and set the report type label and name
- Define the relationships to secondary objects by dragging fields from the "Available Objects" panel
- Save the report type and note its unique API name for reference
- Build a report from your custom type by clicking Reports > New Report and selecting your custom report type from the list
- Drag fields from the left panel into the report layout (columns, filters, grouping)
- Apply filters using the Filter panel to narrow data (e.g., "Status equals Closed Won")
- Save the report with a descriptive name, select a folder, and choose the report format (Tabular, Summary, Matrix, or Joined)
- Create a dashboard by going to Dashboards > New Dashboard, then add dashboard components
- Link report panels to your saved reports and configure refresh intervals in the dashboard settings
Code
// Salesforce Report Builder - SOQL equivalent for testing your report logic
List<Opportunity> reportData = [
SELECT
Id,
Name,
StageName,
Amount,
CloseDate,
Account.Name
FROM Opportunity
WHERE StageName = 'Closed Won'
AND CloseDate = THIS_FISCAL_YEAR
ORDER BY Amount DESC
LIMIT 10000
];
// Parse results into report structure
Map<String, AggregateResult> summaryByStage = new Map<String, AggregateResult>();
AggregateResult[] stageTotals = [
SELECT StageName,
COUNT(Id) recordCount,
SUM(Amount) totalAmount
FROM Opportunity
WHERE CloseDate = THIS_FISCAL_YEAR
GROUP BY StageName
];
for (AggregateResult result : stageTotals) {
String stage = (String) result.get('StageName');
Decimal count = (Decimal) result.get('recordCount');
Decimal total = (Decimal) result.get('totalAmount');
summaryByStage.put(stage, result);
System.debug('Stage: ' + stage + ' | Count: ' + count + ' | Total: ' + total);
}
// Dashboard component configuration (JSON format for API)
String dashboardConfig = '{' +
'"
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Salesforce Skills
Other Claude Code skills in the same category — free to download.
Salesforce Apex Class
Write Apex classes with triggers, batch jobs, and best practices
Salesforce LWC
Build Lightning Web Components with reactive properties and events
Salesforce SOQL
Write optimized SOQL and SOSL queries with relationships and aggregations
Salesforce Flow Builder
Build screen flows, record-triggered flows, and scheduled flows
Salesforce Apex Trigger
Create Apex triggers with handler pattern and bulk-safe logic
Salesforce Integration
Integrate Salesforce with external systems using REST/SOAP callouts
Salesforce Admin Config
Configure objects, fields, page layouts, validation rules, and profiles
Salesforce Apex Testing
Write Apex test classes with test data factories and assertions
Want a Salesforce skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.