2

I am doing some pipeline research and basically need to create a "snapshot" using the opportunity history table. So I look for the the max created date prior to my chosen date. I get occasionally get more than 1 row per opportunity returned. Are records in this table created in batches? I just don't understand how two rows can be written at the same second.

1
  • Each record represent value change for the specified field, so when you have a few fields for the same record being updated at the same time it's possible
    – o-lexi
    Commented Feb 3, 2017 at 23:37

1 Answer 1

0

Take a look at the documentation on OpportunityHistory:

Usage

This object represents the history of a change to the Amount, Probability, Stage, or Close Date fields of an Opportunity. The OpportunityFieldHistory object represents the history of a change to any of the fields of an Opportunity. To obtain information about how a particular opportunity is progressing, query the OpportunityHistory records associated with a given Opportunity. Please note that if an opportunity's Amount, Probability, Stage, or Close Date fields have not changed, nothing will be returned in the OpportunityHistory objects. In this case, query the OpportunityFieldHistory records associated with a given Opportunity to get more information about changes to the opportunity.

So there are a few different scenarios to consider:

  • Zero OpportunityHistory records exist for a specific Opportunity record
    • The Amount, Probability, Stage, and Close Date fields have not changed since the record was created
  • Exactly one OpportunityHistory record exists for a specific Opportunity record
    • Of all the above mentioned fields, only one transaction has changed any of the values.
  • More than one OpportunityHistory record exists for a specific Opportunity record
    • Multiple transactions have changed the values of the aforementioned fields.

You are by no means guaranteed a one-to-one ratio.

You must log in to answer this question.

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