Skip to content

Commit 0220f30

Browse files
Merge pull request #20 from b-vamsipunnam/feature/Working-Branch-April
updated the passing mechanism of org alias via command line and docum…
2 parents eb47420 + 346a86c commit 0220f30

4 files changed

Lines changed: 154 additions & 81 deletions

File tree

README.md

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# Salesforce Objects Scanner
22

3-
**Quickly understand your Salesforce org’s data footprint.**
3+
> Enterprise-grade Salesforce data analysis tool built with Robot Framework and Python.
4+
> Supports scanning all queryable sObjects, retrieving accurate record counts, identifying Large Data Volume (LDV) risk areas, and generating structured Excel reports. Used in enterprise environments for data volume analysis, migration planning, and storage optimization across large-scale Salesforce orgs.
45
5-
Scan all queryable sObjects, get accurate record counts, identify Large Data Volume (LDV) risks, and generate ready-to-analyze Excel reports — all with safe, timeout-protected execution.
6-
7-
> Enterprise-grade Salesforce org analysis tool for data visibility, LDV detection, and migration planning.
8-
> Designed to handle Salesforce orgs with hundreds to thousands of objects while maintaining predictable execution and structured outputs.
96
---
107

118
## Built With
@@ -28,6 +25,8 @@ Built using **Robot Framework + Salesforce CLI**, the tool provides a structured
2825

2926
Native Salesforce tools offer limited visibility into object-level data size and lack a unified way to analyze all sObjects. This tool addresses those gaps by delivering comprehensive, structured reporting across your entire org.
3027

28+
Used by SDETs, Salesforce architects, and migration teams for large-scale Salesforce org analysis.
29+
3130
---
3231

3332
## When to Use This Tool
@@ -55,6 +54,8 @@ Native Salesforce tools have limitations:
5554

5655
## Key Features
5756

57+
- Designed for safe execution in large orgs without hitting long-running query risks
58+
- LDV (Large Data Volume) detection-ready outputs for identifying high-volume objects
5859
- Scans all queryable objects using `sf sobject list --json`
5960
- Executes `SELECT COUNT()` queries across standard and Tooling API objects
6061
- Smart filtering of noisy and unsupported objects
@@ -67,41 +68,47 @@ Native Salesforce tools have limitations:
6768
- INVALID_TYPE / restricted objects
6869
- Per-object execution time tracking
6970
- Generates structured JSON outputs and Excel report
71+
- Excel report structured for LDV analysis (easy sorting, filtering, pivoting)
7072
- Clear execution summary with success and skip metrics
7173
---
7274

7375
## Architecture Overview
7476

77+
Supports large-scale Salesforce orgs with hundreds to thousands of objects, ensuring predictable and observable execution behavior.
78+
7579
**Execution model:**
7680

7781
- **Control Layer:** Salesforce CLI (metadata + queries)
7882
- **Orchestration Layer:** Robot Framework (logic + workflow)
7983
- **Execution Layer:** Process-based execution with timeout protection
8084
- **Output Layer:** JSON artifacts + Excel report
8185

82-
This design ensures predictable, scalable, and observable execution.
86+
This design ensures predictable, scalable, and observable execution across large Salesforce orgs.
8387
Each execution creates an isolated run folder to ensure clean, reproducible outputs.
8488

8589
<p align="center">
86-
<img src="docs/architecture.png" width="700">
90+
<img src="docs/architecture.png" width="700" alt="Salesforce Objects Scanner architecture diagram">
8791
</p>
8892

8993
## Technology Stack
9094

91-
- Robot Framework
92-
- Salesforce CLI (sf)
93-
- Python
94-
- Custom ExcelWriter utility
95+
- **Robot Framework** – Serves as the orchestration layer, enabling keyword-driven automation to structure the scanning workflow, manage execution flow, and keep the solution readable and maintainable
96+
- **Salesforce CLI (sf)** – Acts as the control interface to Salesforce, handling authentication and executing SOQL queries such as SELECT COUNT() to retrieve object-level record counts
97+
- **Python** – Provides the extensibility layer for building custom utilities, handling JSON parsing, processing results, and enhancing overall automation capabilities
98+
- **ExcelWriter utility** – Custom-built reporting component that transforms raw scan results into structured Excel reports, making it easy to analyze object distribution and identify LDV (Large Data Volume) risk areas
9599

96100
---
97101

98102
## Quick Start
99103

100104
### Prerequisites
101105
- Python 3.8+
106+
- Node.js (required for Salesforce CLI)
102107
- Salesforce CLI (`sf`)
103108
- Robot Framework and dependencies
104109

110+
> Salesforce CLI requires Node.js as a runtime dependency.
111+
105112
### Installation
106113

107114
```bash
@@ -126,17 +133,11 @@ pip install -r requirements.txt
126133
```bash
127134
sf org login web --alias MyOrg
128135
```
129-
2. Configure org alias
130-
Before running, update the ${ORG_ALIAS} variable in: `src/robot/orchestrator/scan.robot`
131-
```robot
132-
*** Variables ***
133-
${ORG_ALIAS} MyOrg
134-
```
135-
4. Run:
136+
2. Run the scanner by passing the org alias:
136137
```bash
137-
robot --test Object_Scanner -d results src/robot/orchestrator/scan.robot
138+
robot --test Object_Scanner -d results --variable ORG_ALIAS:MyOrg src/robot/orchestrator/scan.robot
138139
```
139-
5. Check outputs:
140+
3. Check outputs:
140141
```text
141142
JSON files : output/
142143
Excel report : output/SF_Objects_<datetime>.xlsx
@@ -185,13 +186,24 @@ salesforce-objects-scanner/
185186

186187
## Configuration
187188

188-
| Variable | Default Value | Description |
189-
|--------------------------------|---------------|--------------------------------------|
190-
| `${ORG_ALIAS}` | MyOrg | Target org alias |
191-
| `${INCLUDE_TOOLING}` | ${TRUE} | Include Tooling API objects |
192-
| `${DISCOVER_TOOLING_OBJECTS}` | ${TRUE} | Dynamically discover Tooling objects |
193-
| `${DELAY_SECONDS}` | 0.1 | Delay between queries |
194-
| `${MAX_QUERY_TIMEOUT_SECONDS}` | 120 | Per-query timeout |
189+
| Variable | Required | Default Value | Description |
190+
|--------------------------------|----------|---------------|--------------------------------------------------|
191+
| `${ORG_ALIAS}` | Yes || Salesforce org alias (passed via CLI) |
192+
| `${INCLUDE_TOOLING}` | No | ${TRUE} | Include Tooling API objects |
193+
| `${DISCOVER_TOOLING_OBJECTS}` | No | ${TRUE} | Dynamically discover Tooling objects |
194+
| `${DELAY_SECONDS}` | No | 0.1 | Delay between queries |
195+
| `${MAX_QUERY_TIMEOUT_SECONDS}` | No | 120 | Per-query timeout (in seconds) |
196+
197+
#### `${ORG_ALIAS}` must be provided at runtime:
198+
199+
```bash
200+
--variable ORG_ALIAS:<your_org>
201+
```
202+
#### Example:
203+
204+
```bash
205+
robot --test Object_Scanner -d results --variable ORG_ALIAS:DeveloperOrg src/robot/orchestrator/scan.robot
206+
```
195207

196208
---
197209

@@ -208,9 +220,11 @@ salesforce-objects-scanner/
208220

209221
### Excel Report
210222

211-
| File | Purpose |
212-
|-------------------------------|--------------------------------------|
213-
| `SF_Objects_<datetime>.xlsx` | Consolidated report for analysis |
223+
| File | Purpose |
224+
|-------------------------------|-----------------------------------------------------------------------------------|
225+
| `SF_Objects_<datetime>.xlsx` | Consolidated report with record counts, execution times, and LDV analysis support |
226+
227+
> Sort Excel by record count to quickly identify top LDV objects.
214228
215229
---
216230

@@ -241,16 +255,18 @@ Skipped: 22
241255
* Skipped objects are classified and logged with clear reasons
242256
* Execution time is tracked per object
243257
* Results are stored in structured JSON and Excel formats
258+
* Validates ORG_ALIAS at runtime and fails fast if not provided
244259

245260
---
246261

247262
## Limitations & Trade-offs
248263

249-
* COUNT() queries may be slow for large datasets
264+
* COUNT() queries may be slow for very large datasets (millions of records)
250265
* Some objects require WHERE clauses and are skipped
251266
* Dependent on Salesforce CLI output format
252-
* Currently optimized for Windows environments
253-
* Very large orgs may take 10–30+ minutes depending on size and network conditions
267+
* Subject to Salesforce governor limits, query timeouts, and API request limits
268+
* Certain objects (e.g., EventLogFile, Big Objects) may have special behaviors
269+
* Very large orgs may take 30-50+ minutes depending on size and network conditions
254270

255271
---
256272

@@ -261,17 +277,25 @@ Skipped: 22
261277

262278
---
263279

280+
## Performance Tips
281+
282+
- Run during off-peak hours for large orgs
283+
- Use a sandbox for initial analysis
284+
- Increase `${MAX_QUERY_TIMEOUT_SECONDS}` for very large objects
285+
- Reduce `${DELAY_SECONDS}` carefully to balance speed vs stability
286+
287+
---
288+
264289
## Roadmap
265290

266291
Planned enhancements:
267-
* Parallel execution (Pabot integration)
292+
* Parallel execution (Pabot integration for large org performance)
268293
* Resume capability for long scans
269294
* Cross-platform support improvements
270295
* Advanced analytics (top objects, trends)
271296

272297
---
273298

274-
275299
## Troubleshooting
276300

277301
| Issue | Cause | Fix |

docs/architecture.png

-787 Bytes
Loading

src/robot/orchestrator/scan.robot

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
*** Settings ***
2-
Documentation Retrieve and log record counts for Salesforce objects from Excel list
2+
Documentation Retrieve and log record counts for all queryable Salesforce objects using Salesforce CLI (sf), with filtering, timeout protection, and structured output generation.
33
Resource ../resources/keywords.robot
44
Suite Teardown Cleanup Suite
55

6-
*** Variables ***
7-
# Set this to the same alias used in: sf org login web --alias <org_name>
8-
${ORG_ALIAS} MyOrg
9-
106
*** Test Cases ***
117
Object_Scanner
12-
Get All Object Record Counts ${ORG_ALIAS}
8+
Get All Object Record Counts1 ${ORG_ALIAS}

0 commit comments

Comments
 (0)