0

Fields like Opportunity - Total Revenue (Opportunity.Amount) and Opportunity Product - Total Price (OpportunityLineItem.TotalPrice) are calculated by Salesforce automatically.

These calculations are not found in the metadata, but are instead handled by Salesforce internally.

How can I identify all of the fields that contain these types of "behind the scenes" calculations?

3
  • do you want to get these programmatically? Or to find in the doc?
    – cropredy
    Commented Oct 13, 2022 at 23:27
  • @cropredy It would be nice to find these programmatically, but if there is an overview list of these fields in the documentation, that could be a start. Commented Oct 13, 2022 at 23:31
  • well, if you look at Opportunity Object Ref doc and read the notes for the fields; you can see which ones are calculated/derived
    – cropredy
    Commented Oct 14, 2022 at 0:18

1 Answer 1

1

There is no one place to find a comprehensive list of "magic" fields; you would have to check the documentation one page at a time for each object you're interested in. For example, if you look at OpportunityLineItem, you'll see entries like:

CanUseQuantitySchedule

Indicates whether the opportunity product can have a quantity schedule (true) or not (false). This field is read-only.

And:

Discount

Discount for the product as a percentage.

When updating these records:

  • If you specify Discount without specifying TotalPrice, the TotalPrice is adjusted to accommodate the new Discount value, and the UnitPrice is held constant.
  • If you specify both Discount and Quantity, you must also specify either TotalPrice or UnitPrice so the system knows which one to automatically adjust.

There are dozens, if not hundreds, of these fields, and you'll only find that information in the documentation. In many cases, the field will be read-only (as the first example), but many will not, and have special rules. Also, look at the bottom of each object's field list for special rules for the object that may apply.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .