Prospect number automation ensures every lead and opportunity in Salesforce receives a unique, sequential identifier at the moment of creation. The number persists through the lead-to-opportunity conversion lifecycle, providing a stable reference across the entire sales process — and into downstream systems like server-side project folder creation.
This pattern was implemented and validated during a Quarra Stone Salesforce working session. The core mechanics generalize well to any org that needs durable, human-readable record identifiers.
When a new lead or opportunity is created, a flow or trigger assigns the next available prospect number in sequence. The field is write-protected for non-admin users — standard users cannot manually edit it — which preserves numbering integrity.
Quarra Stone context: The automation was confirmed working for both leads and opportunities created from the date of implementation forward. System admins (Lincoln Durham, Mark Hope, Karly Oykhman) retain manual edit rights on the field.
The prospect number is carried forward when a lead converts to an opportunity. This means the same identifier tracks the record from initial qualification through close, and can be used as a stable key for any external integrations (e.g., creating a named project folder on a file server).
Key decision (Quarra Stone): Lincoln Durham confirmed the intent is for everything to start as a lead. Prospect number continuity through conversion was a prerequisite for enforcing that workflow — previously, users had an incentive to skip leads and go straight to opportunities to avoid the numbering gap.
Records created before automation was enabled will have no prospect number. A script can be written to iterate over all open leads (and opportunities) lacking a number and assign one, subject to two constraints:
Trade-off to communicate to clients: Backfilled numbers will not be in chronological sequence relative to existing opportunity numbers. This is expected and acceptable as long as uniqueness is guaranteed.
Prospect_Number__c) on both the Lead and Opportunity objects.on Lead/Opportunity before insert:
if Prospect_Number__c is blank:
next_num = MAX(all existing Prospect_Number__c across Lead + Opportunity) + 1
while next_num exists anywhere:
next_num += 1
record.Prospect_Number__c = next_num
For the backfill script, the same uniqueness check applies. Run in a sandbox first and validate the resulting number range before deploying to production.
Once a prospect number exists on a lead, it can serve as the folder name key for automated server-side folder creation. This requires API access to the file server — at Quarra Stone, this involves coordinating with their IT provider (Vieth) to expose an endpoint or grant API access.
See [1] and [2] for details on the Vieth integration planning.
| Decision | Rationale |
|---|---|
| Prospect numbers generated at lead creation, not opportunity | Enforces lead-first workflow; removes the incentive to skip leads |
| Numbers persist through conversion | Enables stable cross-system references (folders, external records) |
| BANT scoring stays on lead only | Once converted, the lead has already been deemed worthy; scoring is no longer needed |
| Backfill uses non-colliding number range | Preserves integrity of existing opportunity numbers |