---
title: Quarra Stone — Prospect Number Auto-Generation
type: article
created: '2025-09-29'
updated: '2025-09-29'
source_docs:
- raw/2025-09-29-call-w-twistellar-quarra-salesforce-90463130.md
tags:
- salesforce
- quarra-stone
- automation
- prospect-numbers
- leads
- opportunities
- sharepoint
layer: 2
client_source: null
industry_context: null
transferable: true
---

# Quarra Stone — Prospect Number Auto-Generation

## Overview

Quarra Stone requires sequential, auto-generated prospect numbers assigned at lead creation in Salesforce. These numbers serve as the primary identifier linking leads, opportunities, and external SharePoint folders throughout the project lifecycle. This article documents the agreed implementation spec and the related folder automation work that is still being scoped.

Discussed in a working session with Twistellar (Sergei Logvin) on 2025-09-29. See also [[wiki/clients/quarra-stone/_index]] and the related [[wiki/knowledge/salesforce/quarra-opportunity-creation-restriction]] fix addressed in the same call.

---

## Prospect Number Field Specification

### Lead Object

| Attribute | Value |
|---|---|
| Field name | `Prospect_Number__c` |
| Label | Prospect Number |
| Object | Lead |
| Auto-generated | Yes — sequential on lead creation |
| Starting value | **P21150** (last known used number was P21138; gap added as buffer) |
| Format | `P` prefix + 5-digit integer (e.g. P21150, P21151, …) |
| Unique | Yes |
| User-editable | **No** — read-only after creation, treated like a system ID |

> **Rationale for lead-level assignment:** Numbers are assigned at lead creation rather than opportunity creation so that every prospect has an identifier from first contact, even if the lead is never converted. Some leads will consume a number without producing an opportunity — this is acceptable.

### Opportunity Object

On lead conversion, the prospect number must be **mapped** from the lead field to the corresponding opportunity field (`Prospect_Number__c` on Opportunity). This ensures continuity of the identifier through the sales pipeline.

Prior to this automation, prospect numbers on existing opportunities were entered manually (likely from a spreadsheet). All existing opportunities already carry numbers; the automation only needs to handle net-new leads going forward.

---

## Implementation Notes

- Use a **before-insert Flow or Apex trigger** on the Lead object to auto-populate the field at creation time.
- The sequential counter must be stored in a way that prevents race conditions (e.g. a custom metadata record or a dedicated counter object with row-locking, or an Apex sequence pattern).
- The field should be surfaced read-only on both the Lead and Opportunity page layouts.
- Confirm that the **lead field mapping** in Salesforce Setup maps `Lead.Prospect_Number__c` → `Opportunity.Prospect_Number__c` so conversion carries the value automatically.

---

## Folder Creation Automation (Pending Scoping)

The prospect number is also used to name a corresponding folder in **Microsoft SharePoint**. Today this is a manual process: a user copies the prospect number from Salesforce and creates a folder by hand. The desired end state is full automation triggered at opportunity creation (or possibly at lead creation — to be confirmed with client).

### Folder naming convention
The folder name is not the prospect number alone — it appends part of the prospect/company name. Exact convention to be confirmed with Stephen Rousseau on the Friday call.

### Technical options under consideration

1. **SharePoint connector** — trigger folder creation via a Salesforce-to-SharePoint connector (e.g. MuleSoft, Zapier, or a native Flow HTTP callout).
2. **Salesforce Files / Content** — create the folder structure within Salesforce itself (Dimitri's suggestion), eliminating the SharePoint dependency.
3. **External middleware** — a Linux VM or Node.js web app that listens for Salesforce events and calls the SharePoint API.

The Asymmetric/Twistellar team will recommend the approach; the client needs to provide SharePoint API credentials and confirm the preferred folder location and naming convention.

### Open questions for Friday's call (Stephen Rousseau)
- Should the folder be created at **lead creation** or at **opportunity conversion**? (Sergei noted a prior recording suggested two separate folder triggers — one per stage.)
- Is the client willing to keep folders in Salesforce, or do they require SharePoint?
- What is the exact folder naming convention?
- Who can provide SharePoint API credentials / tenant access?

---

## Related Tasks (Same Session)

The following additional tasks were confirmed in-progress with Twistellar during the same call:

- **Remove opportunity-creation restriction** — a permission previously limited opportunity creation to user "Lincoln" only; being removed as urgent priority. See [[wiki/knowledge/salesforce/quarra-opportunity-creation-restriction]].
- **New users** — two new Salesforce users being created per client specifications.
- **Field rename** — "Primary Stone Type" → "Primary Material Type" on the Lead object, plus a new picklist value.
- **Opportunity Teams** — feature being enabled; any Salesforce user can be added regardless of role. Sergei to research adding external partners (e.g. architects) as guest users so they can receive notifications without a full license.

---

## Action Items

| # | Action | Owner | Status |
|---|---|---|---|
| 1 | Add `Prospect_Number__c` to Lead: auto-generate, unique, non-editable, start at P21150, map to Opportunity on conversion | Sergei Logvin (Twistellar) | 🔲 Open |
| 2 | Remove Lincoln-only opportunity creation restriction — urgent | Sergei Logvin (Twistellar) | 🔲 Open |
| 3 | Contact Stephen Rousseau re Friday 11am ET call; inform him of opp-creation fix and prospect number automation; request attendance to discuss folder creation | Karly Oykhman | 🔲 Open |
| 4 | Research adding external users (e.g. architects) to Opportunity Teams via guest user option | Sergei Logvin (Twistellar) | 🔲 Open |
| 5 | Friday call: confirm folder creation trigger timing, naming convention, SharePoint vs. Salesforce preference, and API credentials path | All | 🔲 Scheduled |

---

## Key Decisions

- Prospect numbers will be generated on the **Lead**, not the Opportunity, so every prospect has an ID from first contact.
- Starting number is **P21150** (buffer above last known manual entry of P21138).
- The field is **non-editable** post-creation to prevent accidental corruption of the identifier chain.
- Folder automation details are **deferred** to the Friday client call with Stephen Rousseau.

---

## Participants (2025-09-29 Call)

- Mark Hope — Asymmetric
- Karly Oykhman — Asymmetric (account manager)
- Sergei Logvin — Twistellar (external, implementation)