| Change Log | Date | Owner |
|---|---|---|
| Page Created |
| |
Enhancement: Probability Weighted Contribution Margin: CPROMOG-12 - Getting issue details... STATUS |
| MILIC-ext, Nikola |
User Roles and Permissions
Opportunity Line Items (OLIs) inherit their visibility and access controls directly from their parent Opportunity records. To check opportunity Access please go to following page and check under User Roles and Permissions
Opportunity Products: Field-Level Update and Validation Overview
1. GBU (SLV2_GBU__c)
- On Create:
- The
SLV_OpportunityProductManagement.syncGBUmethod sets the GBU onOpportunityLineItemto match theOpportunityGBU field (SLV6_OPP_GBU__c).
- The
- On Update:
- The same
syncGBUmethod is invoked in theSLV_OpportunityProductManagementclass to sync the GBU when the Opportunity or Opportunity Product’s GBU changes.
- The same
2. Contribution Margin (Contribution_Margin__c)
- On Update:
- The
updateContributionMarginmethod inSLV_OpportunityProductManagementadjustsContribution_Margin__cbased on the calculation method set inSLV5_OPR_CM_Calculation_Method__c:- If the method is Percent, the margin is set to
Contribution_Margin_Percent__c. - If the method is Amount, the margin is set to
Contribution_Margin_Amount_per_UoM__c.
- If the method is Percent, the margin is set to
- The
3. Opportunity Name (SLV_Product_Name__c)
On Create:
- The
updateOpportunitynamemethod inSLV_OpportunityProductManagementsets the Opportunity name based on theSLV2_OLI_Application__cfield if it does not match the current value inSLV_Product_Name__c.
- The
On Update:
- This same method (
updateOpportunityname) updates the Opportunity name if there is a mismatch betweenSLV2_OLI_Application__candSLV_Product_Name__c.
- This same method (
On Delete:
- After deleting an Opportunity Product, the Opportunity name is updated through
updateOpportunitynameto reflect the change.
- After deleting an Opportunity Product, the Opportunity name is updated through
4. Product Forecast (SLV_Product_Forecast__c)
On Create:
- When an Opportunity Product is created,
SLV_updateProductForecastupdates forecast records based onSLV5_OPR_Unit_of_Measure__candSLV5_OPR_CM_Calculation_Method__c.
- When an Opportunity Product is created,
On Update:
- The same
SLV_updateProductForecastmethod recalculates forecast records whenSLV5_OPR_Unit_of_Measure__corSLV5_OPR_CM_Calculation_Method__cchanges.
- The same
On Delete:
SLV_deleteProductForecastdeletes forecast records when an Opportunity Product is removed.
5. Opportunity Involved Products (SLV_Involved_Product__c)
On Create:
updateOpportunityInvolvedProductinSLV_OpportunityProductManagementaddsProduct2.Namefrom theOpportunityLineItemtoSLV_Involved_Product__con the Opportunity.
On Update:
- This method (
updateOpportunityInvolvedProduct) also triggers on updates, adjustingSLV_Involved_Product__cbased on the list of related Opportunity Products.
- This method (
On Delete:
- When an Opportunity Product is deleted, the
updateOpportunityInvolvedProductmethod removes the product from the Opportunity'sSLV_Involved_Product__cfield.
- When an Opportunity Product is deleted, the
6. Product End Use (SLV2_OPP_Product_End_Uses__c)
On Create:
- In the
updateOpportunityInvolvedProductmethod,SLV_End_Use__cfrom the Opportunity Product is added toSLV2_OPP_Product_End_Uses__con the Opportunity.
- In the
On Update:
- The same method updates
SLV2_OPP_Product_End_Uses__cto reflect any changes inSLV_End_Use__cfor related Opportunity Products.
- The same method updates
On Delete:
- When an Opportunity Product is deleted, the
updateOpportunityInvolvedProductmethod removes itsSLV_End_Use__cfromSLV2_OPP_Product_End_Uses__c.
- When an Opportunity Product is deleted, the
7. Application (SLV2_OPP_Application1__c)
On Create:
SLV_End_Use__r.SLV_Application__cvalues are added toSLV2_OPP_Application1__cfor new Opportunity Products inupdateOpportunityInvolvedProduct.
On Update:
- Updates to
SLV_End_Use__r.SLV_Application__con Opportunity Products prompt recalculation ofSLV2_OPP_Application1__c.
- Updates to
On Delete:
- When an Opportunity Product is deleted, the method removes its application data from
SLV2_OPP_Application1__c.
- When an Opportunity Product is deleted, the method removes its application data from
8. Yearly Revenue (SLV_Yearly_Revenue__c)
- On Create and Update:
updateProductTotalAmountinSLV_OpportunityProductManagementsetsSLV_Yearly_Revenue__cbased onSLV_Yearly_Volume_at_Maturity__candSLV5_OPR_Target_Unit_price_per_UoM__c.- If these values are null,
SLV_Yearly_Revenue__cis set to zero.
9. Product History (SLV6_Opportunity_Product_History__c)
- On Create and Update:
addOpportunityProductHistorycreates records inSLV6_Opportunity_Product_History__cto log changes in fields listed inSLV6_Opportunity_Product_fields_TrackingFieldSet.
- On Delete:
deleteOpportunityProductHistorydeletes history records associated with deleted Opportunity Products.
10. Negotiation History (SLV_Negotiation_History__c)
- On Delete:
- The
deleteNegotiationHistorymethod deletes negotiation history records associated with deleted Opportunity Products.
- The
11. Dummy Product Flag (SLV_Dummy_Product_Exists__c)
- On Create and Update:
updateDummyProductFlaginSLV_OpportunityProductManagementsets theSLV_Dummy_Product_Exists__cflag on the Opportunity if dummy products are linked to it.
- On Delete:
- This flag is also reset if dummy products are removed from the Opportunity.
12. Total Amount (SLV_Product_Total_Amount__c)
- On Create and Update:
updateProductTotalAmountcalculates and updates theSLV_Product_Total_Amount__cfor Opportunity Products, using volume and target unit price fields.
Validation Rules for Opportunity Products
1. No Dummy Product for Qualified Opportunities
- Error Message: "Dummy Products cannot be added to Opportunities marked as Product Qualified."
- Condition: This rule enforces that no dummy products are associated with qualified Opportunities. It triggers when:
- User Permissions: The user does not have permission to bypass validation rules (
$Permission.Bypass_Validation_Rules = FALSE). - Opportunity Type: The Opportunity’s Type field (
Opportunity.Type) is set to “Product Qualified.” - Product Name: The Product Name field on the Opportunity Line Item (
OpportunityLineItem.Product2.Name) is set to “Dummy Product.”
- User Permissions: The user does not have permission to bypass validation rules (
2. Manufacturing Plant Validation
- Error Message: "Selected Manufacturing Plant is not approved for this Opportunity."
- Condition: Ensures only approved manufacturing plants are used in Opportunity Line Items. It activates when:
- User Permissions: The user does not have permission to bypass validation rules (
$Permission.Bypass_Validation_Rules = FALSE). - Manufacturing Plant Selection: The Opportunity Line Item’s Manufacturing Plant field (
OpportunityLineItem.Manufacturing_Plant__c) is set to an unapproved plant (not within the allowed list for the Opportunity type).
- User Permissions: The user does not have permission to bypass validation rules (
3. Shipping Plant Validation
- Error Message: "Selected Shipping Plant is not allowed for this Opportunity."
- Condition: This rule enforces that only approved shipping plants are selected for an Opportunity. It is triggered when:
- User Permissions: The user does not have permission to bypass validation rules (
$Permission.Bypass_Validation_Rules = FALSE). - Shipping Plant Selection: The Opportunity Line Item’s Shipping Plant field (
OpportunityLineItem.Shipping_Plant__c) does not match any approved shipping locations associated with the Opportunity.
- User Permissions: The user does not have permission to bypass validation rules (
4. Contribution Margin Calculation Method Consistency
- Error Message: "Contribution Margin must be set according to the selected Calculation Method."
- Condition: This rule ensures that the Contribution Margin aligns with the selected calculation method. It activates when:
- Calculation Method: The Opportunity Line Item’s Contribution Margin Calculation Method field (
OpportunityLineItem.SLV5_OPR_CM_Calculation_Method__c) is updated. - Contribution Margin: The Contribution Margin (
OpportunityLineItem.Contribution_Margin__c) is inconsistent with the selected Calculation Method (either “Percent” or “Amount”).
- Calculation Method: The Opportunity Line Item’s Contribution Margin Calculation Method field (
Flows
Flow Name: Create Product Forecasts
Purpose:
This flow creates a forecast record for each Opportunity Line Item added to an opportunity, ensuring that forecasts are generated and updated based on specific business rules.
Trigger
- Type: Record-Triggered Flow
- Event: Triggered each time an Opportunity Product record is created.
- Entry Conditions: None – the flow runs for all Opportunity Products and executes immediately.
Logic and Flow Steps
Retrieve Existing Forecasts
- The flow first checks if any forecast records already exist for the Opportunity.
- It retrieves records from Product Forecast where:
- SLV_Product__c equals
$Record > Product ID - SLV_Opportunity__c equals
$Record > Opportunity ID
- SLV_Product__c equals
Check for Existing Forecasts
- Decision: If forecast records exist, the flow ends.
- If No Forecasts Exist: The flow proceeds to a counter-based decision to manage forecast creation.
Counter Logic and Forecast Creation
Counter Check (Counter < 5):
- If fewer than 5 forecasts exist, the flow:
- Assigns values to all relevant fields in the forecast record.
- Sets the Year field to:
- If fewer than 5 forecasts exist, the flow:
TEXT(YEAR(DATEVALUE(DATETIMEVALUE({!SLV7_OPP_Targeted_first_delivery_date}))) + {!counter})
Counter Check (Counter ≥ 5):
- When the counter reaches 5, it stops assigning values and creates the forecast records with the previously assigned field values.
Field Assignments (Set Values)
- The following fields are populated from the Opportunity Line Item to the Forecast record:
- Currency ISO Code
- Opportunity
- Unit of Measure
- Opportunity Product ID
- Product
- CM Calculation Method
- Volume
- Price
- Contribution Margin (Amount) per UoM
- Contribution Margin
- Year
- The following fields are populated from the Opportunity Line Item to the Forecast record:
Exception for Oil & Gas GBU
- For Oil & Gas GBU, an exception is applied:
- The forecast record for the first delivery year is created with all fields set to 0.
Enhancements
Probability Weighted Contribution Margin: CPROMOG-12 - Getting issue details... STATUS
- A new field was added to Opportunity product called "Probability Weighted Contribution Margin".
- This field calculates potential margin based on opportunity probability:
SLV7_OPR_Contribution_Margin_Tot_Amount__c * Opportunity.Probability
- Field is not visible on OLI layout but can be added on report by any user who can see the OLI
The best way to get IT support is to use the new
Service One Platform.

