1. Overview

The Realized Sales section is part of the Opportunity Product Forecasting functionality, aimed at capturing and managing realized sales for products associated with opportunities. It supports the creation, update, and synchronization of realized sales records (ORSY), linking opportunity line items to forecasted product sales for specific years.

The purpose of this document is to provide an overview of the functionality and design for managing realized sales, including creation, update, and deletion processes based on product forecasts.


2. Scope

This functional design covers the Realized Sales section, focusing on the following features:


3. Functional Requirements

3.1 Realized Sales Data Creation

The system automatically creates Opportunity_Realized_Sales_Year__c (ORSY) records when a product forecast (SLV_Product_Forecast__c) is created or updated. ORSY records track realized sales for a given opportunity product over a specific year.

Inputs:
Outputs:

3.2 Synchronization of ORSY Records

ORSY records are synchronized with their associated opportunity and product line items based on the product forecasts. When changes occur in the forecast data, the corresponding ORSY records must be updated or created.

Trigger Events:
Process Flow:
  1. Mapping Forecast to Opportunity Line Items:
  2. ORSY Record Creation:
  3. Handling Duplicates:
Data Synchronization Logic:

3.3 Updates to Realized Sales Data

The system supports updates to ORSY records based on changes in the product forecast. Key financial fields, such as price, volume, and contribution margin, are updated if modified in the forecast.

Updatable Fields:
Non-Updatable Fields:

3.4 Deletion of ORSY Records

ORSY records are deleted when the corresponding product forecasts are removed. This ensures that orphaned ORSY records do not remain in the system.

Deletion Logic:

4. Process Diagrams

4.1 ORSY Creation Process


Product Forecast (SLV_Product_Forecast__c) Created or Updated | v Match Forecast to Opportunity Line Item (OLI) | v Create or Update ORSY Records for the Forecast Year(s) | v Insert or Update Financial Data in ORSY

4.2 ORSY Deletion Process

mathematic
Product Forecast (SLV_Product_Forecast__c) Deleted 

Find Related ORSY Records (Opportunity_Realized_Sales_Year__c) 

Bulk Delete ORSY Records


5. Validation and Error Handling


6. Assumptions