Sub topic 2
Key opportunity fields
This chapter assumes you can navigate Salesforce apps, tabs, list views, and record pages. It also assumes you know the difference between standard and custom fields, and that you know how Accounts, Contacts, and Leads relate. You should also have a basic idea of a sales pipeline.
The previous chapter introduced the Opportunity object as a record of a potential deal. This chapter covers the standard fields that make an opportunity useful. A few of them drive pipeline reports and forecasts. Others are there to guide the rep. Knowing which is which helps you decide what to require, what to automate, and what to leave alone.
The fields that drive pipeline reporting
Most pipeline reports use a small set of standard fields. The table below lists them with the role each one plays.
| Field | API name | Type | What it does |
|---|---|---|---|
| Opportunity Name | `Name` | Text | Identifies the deal in lists, search, and reports. |
| Account Name | `AccountId` | Lookup | Links the deal to the customer. |
| Amount | `Amount` | Currency | The expected deal value. Sums in reports and forecasts. |
| Close Date | `CloseDate` | Date | The date the deal is expected to close, or did close. |
| Stage | `StageName` | Picklist | The deal's position in the sales process. |
| Probability (%) | `Probability` | Percent | The likelihood of winning. Defaults from the stage. |
| Forecast Category | `ForecastCategoryName` | Picklist | How the deal is grouped in forecasts. Defaults from the stage. |
| Type | `Type` | Picklist | Classifies the deal, such as New Business or Existing Business. |
| Lead Source | `LeadSource` | Picklist | Where the deal originated. |
| Next Step | `NextStep` | Text | A short note on the next action. |
| Owner | `OwnerId` | Lookup | The user responsible for the deal. |
Name, Close Date, and Stage are required on every opportunity. Amount is not required by default, although many orgs make it required through validation or a page layout.
Amount
Amount holds the expected value of the deal. Pipeline totals, forecasts, and quota attainment all depend on it, so a blank or wrong Amount distorts every report built on top of it.
Amount behaves differently depending on whether the opportunity has products:
- With no products, Amount is an ordinary field that the rep types in.
- With products, Amount becomes read-only and equals the sum of the product line totals. The rep changes the value by editing the products, not the field.
- If you remove the last product, Amount keeps its last calculated value and becomes editable again.
This is a common source of confusion. If a user reports that they cannot edit Amount, check whether the opportunity has products before you look at field-level security. The chapter on products and price books covers this in more detail.
If your org uses multiple currencies, Amount is stored in the opportunity's currency and converted to the corporate currency for reports. Make sure rows in a report are compared in the same currency.
Close Date
Close Date serves two purposes depending on the stage:
- On an open opportunity, it is the expected close date. Reports such as "closing this quarter" filter on it, and forecasts use it to decide which period the deal belongs to.
- On a closed opportunity, it is the date the deal was actually won or lost.
Because forecasts place a deal in a period by its Close Date, stale dates are a data quality problem. An open deal with a Close Date in the past does not appear in the current period's forecast, even though the rep may still be working it. Many teams use a report or a scheduled flow to surface open opportunities whose Close Date has passed.
When a user moves a deal to Closed Won or Closed Lost, Salesforce does not change the Close Date automatically in every case. Check how your org handles it, and consider a flow that sets Close Date to today when the stage becomes closed, if your reporting depends on actual close dates.
Stage, Probability, and Forecast Category
These three fields form a group. Stage is the one the user picks. Probability and Forecast Category receive default values from the stage, and the user can usually override them. The next two chapters cover stages, probability, and forecast categories in detail. For this chapter, keep one point in mind: Stage is the field that carries the meaning, and the other two follow it.
Descriptive fields
These fields do not usually drive totals, but they make reports more useful.
Type
Type classifies the deal. The standard values include Existing Customer - Upgrade, Existing Customer - Replacement, Existing Customer - Downgrade, and New Customer. You can edit the values to match your business. Typical uses are separating new business from renewals in a pipeline report, or applying different validation rules to each.
Lead Source
Lead Source records where the deal came from, such as Web, Partner Referral, or Trade Show. When you convert a lead, the lead's Lead Source value carries into the new opportunity. A field only copies across if the lead and opportunity both have a matching field, which the lead conversion chapter explains. Keeping the picklist values the same on Lead and Opportunity avoids gaps in source reporting.
Next Step
Next Step is a free-text field of up to 255 characters. Reps use it to note the single next action, for example "Send revised quote Friday". It appears in list views and pipeline reviews, so managers can scan many deals quickly. Because it is optional by default, it is a good candidate for a stage-based validation rule, which the following example shows.
AND(
ISPICKVAL(StageName, "Negotiation/Review"),
ISBLANK(NextStep)
)When you create this rule on Opportunity, set an error message such as "Enter a Next Step before moving to Negotiation/Review", and place the error on the Next Step field. The rule evaluates to true, and blocks the save, when the stage is Negotiation/Review and Next Step is empty.
Note the use of ISPICKVAL. The StageName field is a picklist, so you cannot compare it with = in a formula. Writing StageName = "Negotiation/Review" produces a syntax error.
Fields that are set by the system
Several opportunity fields are not typed in by users. You will see them in reports and filters.
| Field | API name | Meaning |
|---|---|---|
| Closed | `IsClosed` | True when the stage is a closed stage. |
| Won | `IsWon` | True when the stage is a closed-won stage. |
| Created Date | `CreatedDate` | When the record was created. |
| Last Stage Change Date | `LastStageChangeDate` | When the stage last changed. |
| Stage Duration | `LastStageChangeInDays` | Days since the last stage change. |
| Fiscal Quarter and Year | `FiscalQuarter`, `FiscalYear` | Derived from Close Date and your fiscal calendar. |
IsClosed and IsWon are worth special attention. They come from settings on the stage value, not from the stage's name. A stage is closed if it is marked as closed in the picklist setup. That means you can filter on IsClosed = false and not worry about listing every open stage by name. Filters that list stage names break when you add a stage. Filters on IsClosed do not.
Using fields in a pipeline query
The fields above combine into the basic shape of a pipeline report. This SOQL query counts open opportunities and totals their Amount for each stage.
SELECT StageName, COUNT(Id) deals, SUM(Amount) total
FROM Opportunity
WHERE IsClosed = false
GROUP BY StageNameThe query uses IsClosed to exclude Closed Won and Closed Lost. It uses StageName for grouping and Amount for totals. A deal with a blank Amount is counted in deals but adds nothing to total. When a stage's count looks high and its total looks low, missing amounts are the first thing to check.
Common errors and edge cases
- Amount is read-only. The opportunity has products, so Amount is calculated. Edit the products instead.
- Pipeline total is lower than expected. Some deals have a blank Amount. Add a report filter for "Amount equals blank" to find them.
- Deals missing from a quarter's forecast. The Close Date falls outside the period, often because it is stale.
- Validation rule never fires. The stage name in the formula does not match the picklist value, or the rule is inactive.
- Validation rule blocks unrelated saves. A rule that checks only a field, without a stage condition, fires on every edit. A rule like this can block integrations and mass updates that touch old records. Test with data loader jobs and flows, not only the UI.
- Probability does not match the stage. A user overrode the default. Decide whether your org allows this. If it does not, restrict edit access to the field or reset it with a flow.
- Fields do not map from lead conversion. The lead field is not mapped to an opportunity field, or the field types differ.
Choosing which fields to require
Requiring fields at creation slows users down, and requiring them late lets bad data accumulate. A practical approach is to require little at creation, then add stage-based rules as the deal matures.
- At creation, rely on the system requirements: Name, Close Date, and Stage.
- In early stages, consider requiring Amount, so pipeline totals are meaningful.
- In late stages, require fields like Next Step or a competitor field that the team genuinely uses.
- On closing, require a Closed Lost reason if you report on why deals are lost.
Prefer a stage-based validation rule over making a field required on the page layout. A layout requirement applies at every stage and only in the user interface. A validation rule applies at the stage you choose, and applies to API and automation saves as well.
Exercise
A rep says Amount is greyed out on an opportunity and she cannot change it. Field-level security shows she has edit access. What is the most likely cause, and how does she change the value?
Show answer
The opportunity has products. When products are present, Amount is calculated as the sum of the product line totals and is read-only. She changes the value by editing the quantity or sales price of the products, or by adding or removing products.
Exercise
Write a validation rule formula that blocks saving an opportunity in the Closed Lost stage when a custom picklist field named LossReason_c is empty. Explain why the formula uses ISPICKVAL for both fields.
Show answer
Formula: AND(ISPICKVAL(StageName, "Closed Lost"), ISPICKVAL(LossReasonc, "")). Both StageName and LossReason__c are picklist fields, and formulas cannot compare picklist fields with the = operator. ISPICKVAL is the function that tests a picklist's selected value. An empty picklist is tested with ISPICKVAL(field, "").