✅ AI Lead & Opportunity Scoring — Salesforce Solution Design (Using Standard Fields)
1. Objective
Use historical CRM data stored in Salesforce to automatically calculate a score (0–100) representing the likelihood that a Lead converts or an Opportunity close. Score is exposed to end users as a field on Lead/Opportunity for prioritization.
2. High-Level Architecture
Salesforce CRM → Data Prep → Einstein Discovery Model → Prediction Service →Lead/Opportunity Scoring Field → Dashboards & Prioritization
3. Data Inputs (Standard Salesforce Fields Only)
LEAD Standard Field
Lead Source : High predictor (Inbound vs. Outbound vs. Referral)
Industry : Conversion varies by industry
Country / City : Regional behaviors
Rating : Rep’s quality indication
Number Of Employees : Size correlates with intent
Annual Revenue : Buying power
Created Date : Seasonality or pipeline spikes
Last Activity Date: Engagement drives conversion
Email/Phone Status: Contactability
Owner Role :Inside Sales vs. Field Sales
OPPORTUNITIES Standard Field
Stage Name : Defines advancement probability
Amount : High or low value deals show patterns
Close Date : Time-to-close, overdue risk
Type : New Business vs. Upsell
Lead Source : Same correlation as above
Forecast Category : Alignment with rep expectations
Probability : Existing estimation from sales
Account Industry : Industry correlation
Created Date : Time-in-pipeline
Last Modified Date : Activity freshness
Owner Role : Experience level
📊 4. Data Preparation Steps
4.1 Data Cleansing
Remove deleted and very old records (> 3 years)
Ignore Leads with missing Company / Email
Only include Opportunities with closed status (Closed Won / Lost)
4.2 Feature Engineering (no custom fields required)
Days Since Last Activity = Today – LastActivityDate
Opportunity Age = Today – CreatedDate
Stage Duration = LastModified – Last Stage Change
These are computed automatically by Einstein Discovery; no custom fields needed.
🤖 5. Model Build Using Salesforce Einstein
Two paths depending on your edition:
5A. If You Have Salesforce Einstein
Use Einstein Discovery (CRM Analytics).
Steps:
Create a Dataset using Leads (Converted = 1, Not Converted = 0).
Add standard fields as predictors.
Train Einstein Discovery model:
o Target: IsConverted
o Type: Classification
Deploy model:
o Output: Lead Conversion Score
o Expose scoring field on Lead.
For Opportunities:
Dataset from Opportunity with Stage = Closed Won or Closed Lost
Target field: IsClosedWon
Deploy model → Opportunity Win Score
Configure model refresh schedule.
5B. If You Do Not Have Einstein
Still possible using Named Credentials + External AI (e.g., SageMaker, OpenAI, Vertex).
Steps:
Extract CRM Data via Apex Scheduled Job → callout → your model.
Model predicts conversion likelihood based on standard fields.
Results are returned to Salesforce via API.
Update scoring fields:
o Lead_Score__c
o Opportunity_Score__c
🧩 6. Salesforce Components Required
Custom Score Fields : Lead Score (0–100), Opportunity Score (0–100)
Einstein Discovery / External Model : Predictive engine
Apex Scoring Batch : Calls the model and updates scoring fields (if using external model)
Flow / Trigger : Recalculate score on creation/update
List Views : “High Priority Leads” (>70 score)
Reports & Dashboards : Conversion insights, win propensities