> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getveles.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Opportunity

> The Veles fields the managed package adds to the standard Salesforce Opportunity.

Reports, forecasts and commission tools read the Opportunity, so the package
adds **Veles fields to your standard Opportunity**: the linked
[Proposal](https://docs.getveles.com/sfdc-managed-package/objects/proposal.md)'s stage and type, and its
primary [Quote](https://docs.getveles.com/sfdc-managed-package/objects/quote.md)'s totals, ARR, term and
dates. The Veles sync copies them each time the proposal syncs and clears
them when the Opportunity is unlinked from Veles or the proposal is deleted.
Salesforce forecasting cannot use formula fields, so these are real fields,
kept in sync by Veles.

Veles writes only the `Veles__` fields below. It never writes Amount, Stage,
Close Date or any other field of yours. To fill Amount, copy the Veles field
your org calls Amount into it: see
[Fill Amount from Veles](#fill-amount-from-veles).

> [!NOTE]
>
> Salesforce does not let a package change your Opportunity page layout. Add
> the Veles fields to it yourself: see
> [Add the fields to your layout](#add-the-fields-to-your-layout).

## Fields at a glance

| Field | API Name | Type |
| - | - | - |
| Veles Proposal Stage | `Veles__Proposal_Stage__c` | Picklist |
| Veles Proposal Type | `Veles__Proposal_Type__c` | Picklist |
| Veles Primary Quote | `Veles__Primary_Quote__c` | Lookup(Veles Quote) |
| Veles TCV | `Veles__TCV__c` | Currency(16, 2) |
| Veles Recurring TCV | `Veles__Recurring_TCV__c` | Currency(16, 2) |
| Veles One-Time TCV | `Veles__One_Time_TCV__c` | Currency(16, 2) |
| Veles First-Year ARR | `Veles__First_Year_ARR__c` | Currency(16, 2) |
| Veles Exit ARR | `Veles__Exit_ARR__c` | Currency(16, 2) |
| Veles Blended ARR | `Veles__Blended_ARR__c` | Currency(16, 2) |
| Veles Term (Months) | `Veles__Term_Months__c` | Number(4, 0) |
| Veles Start Date | `Veles__Start_Date__c` | Date |
| Veles End Date | `Veles__End_Date__c` | Date |
| Veles Values As Of | `Veles__Values_As_Of__c` | DateTime |

## Field details

### Proposal

The proposal's own facts, so formulas, validation rules and Flows on the
Opportunity can branch on them without reaching into Veles records.

**Veles\_\_Proposal\_Stage\_\_c** `Picklist`

**Veles Proposal Stage** — The proposal's
[Stage](https://docs.getveles.com/sfdc-managed-package/objects/proposal.md#workflow), the same value:
`Draft`, `Editing`, `Awaiting Approval`, `Presenting`, `Draft Order`,
`Finalized`, `Pending Signature`, `Signed` or `Executed`. It is not the
Opportunity's Stage, which stays yours.

**Veles\_\_Proposal\_Type\_\_c** `Picklist`

**Veles Proposal Type** — The proposal's
[Proposal Type](https://docs.getveles.com/sfdc-managed-package/objects/proposal.md#workflow): `New Logo`,
`Renewal` or `Amendment`.

**Veles\_\_Primary\_Quote\_\_c** `Lookup(Veles Quote)`

**Veles Primary Quote** — The proposal's primary quote, the one every value
below is copied from. Empty until a quote is published. Creates the
"Opportunities (Primary Quote)" related list on Veles Quote.

### Money

The primary quote's totals, the same numbers as on the
[Veles Quote](https://docs.getveles.com/sfdc-managed-package/objects/quote.md#money). They are empty
until a quote is published.

**Veles\_\_TCV\_\_c** `Currency(16, 2)`

**Veles TCV** — Total Contract Value (TCV) of the primary quote: One-Time
TCV + Recurring TCV, everything the customer pays over the full term.

**Veles\_\_Recurring\_TCV\_\_c** `Currency(16, 2)`

**Veles Recurring TCV** — The primary quote's Recurring TCV: Recurring
Revenue Prorated summed across its phases.

**Veles\_\_One\_Time\_TCV\_\_c** `Currency(16, 2)`

**Veles One-Time TCV** — The primary quote's One-Time TCV: One-Time Revenue
summed across its phases.

### ARR

A ramp deal has no single ARR, so the Opportunity carries all three the
[quote](https://docs.getveles.com/sfdc-managed-package/objects/quote.md#arr) does. On a flat deal they
are equal.

**Veles\_\_First\_Year\_ARR\_\_c** `Currency(16, 2)`

**Veles First-Year ARR** — The primary quote's first phase's ARR: the
recurring run rate the deal starts at.

**Veles\_\_Exit\_ARR\_\_c** `Currency(16, 2)`

**Veles Exit ARR** — The primary quote's last phase's ARR: the recurring run
rate the deal ends at. The last phase, not the largest, so a deal that ramps
down exits at its lower final rate.

**Veles\_\_Blended\_ARR\_\_c** `Currency(16, 2)`

**Veles Blended ARR** — The primary quote's Recurring TCV averaged over the
term in years: Recurring TCV / (Term (Months) / 12). Empty when the term is
0 months.

### Term

**Veles\_\_Term\_Months\_\_c** `Number(4, 0)`

**Veles Term (Months)** — The primary quote's total term in months, summed
across its phases.

**Veles\_\_Start\_Date\_\_c** `Date`

**Veles Start Date** — The primary quote's start: its first phase's start
date. Empty while the quote's dates are still relative.

**Veles\_\_End\_Date\_\_c** `Date`

**Veles End Date** — The primary quote's end: its last phase's end date.
Empty while the quote's dates are still relative.

### Sync health

**Veles\_\_Values\_As\_Of\_\_c** `DateTime`

**Veles Values As Of** — When the Veles sync last wrote the Veles values on
this Opportunity. It writes them after the proposal's quotes, and only when
a value changed, so a Flow that copies a Veles value into one of your
fields should run when this field changes. Empty once the Opportunity is
unlinked.

## Set up

### Add the fields to your layout

1. In Setup, open **Object Manager > Opportunity > Page Layouts** and edit
   the layout your users see.
2. Add a section (for example "Veles") and drag in the Veles fields your
   team reads. Veles Values As Of is worth including: it tells a reader how
   fresh the numbers are.
3. Leave the fields read-only on the layout, and save.

The Veles CPQ permission set can edit these fields, because the sync writes
them as the rep who pushed. Veles Viewer can only read them. An edit by hand
lasts only until the next sync changes the values.

These fields arrived after the first package releases. In an org on an older
version, the sync leaves the Opportunity alone. After you upgrade, each
Opportunity fills the next time its proposal syncs.

The sync writes only the fields its Salesforce user can edit, and the
proposal and its quotes sync either way. When it leaves fields out (an older
package, a permission set without them, or a user who cannot edit
Opportunities), the run in **Admin > Integrations > Salesforce > Runs** says
which, and the package access check on the **Sync** tab lists them.

### Validation rules, triggers and Flows

The sync updates the Opportunity like any other user, so your validation
rules, triggers and Flows run on its write. When one refuses it, the proposal
and its quotes still sync, and the Opportunity keeps the values it had. In
Veles, **Admin > Integrations > Salesforce > Runs** shows Salesforce's
message on the run. The sync tries again the next time the values change.

The common case is a rule that locks a deal once it is Closed Won. Lock the
fields you mean to lock and leave the `Veles__` fields out: Veles only ever
changes its own fields, so this rule never fires on a Veles write.

```
AND(
  ISPICKVAL(PRIORVALUE(StageName), "Closed Won"),
  OR(ISCHANGED(Amount), ISCHANGED(CloseDate), ISCHANGED(StageName), ISCHANGED(AccountId))
)
```

A rule that refuses every edit to a closed deal needs an exemption for Veles.
Every Veles write changes Veles Values As Of, so exempt the saves that change
it:

```
AND(
  ISPICKVAL(PRIORVALUE(StageName), "Closed Won"),
  NOT(ISCHANGED(Veles__Values_As_Of__c))
)
```

> [!WARNING]
>
> Exempt by field, not by permission. The sync writes as the rep who pushed,
> so a rule that exempts the Veles CPQ permission set would also let that rep
> edit the closed deal by hand.

The user the sync writes as also needs edit access to the Opportunity
record. Reps usually own theirs; an Opportunity they cannot edit is reported
the same way as a refused write.

### Multi-currency orgs

In an org with more than one currency, the money fields read in the
Opportunity's currency. When the primary quote is priced in a different
currency, Veles leaves the Opportunity's values as they were and reports
the mismatch on the run in Veles admin. Change the quote's currency in Veles
or the Opportunity's in Salesforce, then push again.

## Fill Amount from Veles

What Amount means differs from org to org (TCV, First-Year ARR, Blended ARR),
so Veles leaves it to you. With the Veles fields on the Opportunity, filling
it is one Flow that copies the field you call Amount into Amount:

1. In Setup, create a **Record-Triggered Flow** on **Opportunity**, run when
   a record is created or updated, optimized for **Fast Field Updates**.
2. Set the entry conditions: `Veles__Values_As_Of__c` **Is Changed** `True`,
   your Veles field (for example `Veles__First_Year_ARR__c`) **Is Null**
   `False`, and `IsClosed` **Equals** `False` so a closed deal keeps its
   booked Amount.
3. Add an **Update Records** element that updates the Opportunity that
   triggered the Flow, setting **Amount** to that Veles field. Save and
   activate.

A blank Veles value leaves Amount as it was, so unlinking a quote never zeroes
your pipeline. If another Flow or a CPQ sync already writes Amount, turn it
off first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.