Skip to main content

I'm investigating an issue where historical Opportunity Line Items (OLIs)

appear to be deleted when creating a new Quote or performing an Amendment. 

My objective is:

  • Retain historical OLIs for audit/reporting purposes.
  • Prevent business users from manually deleting historical OLIs.
  • Continue allowing CPQ Quote Sync, Amendments, and Renewals to function correctly.

Questions:

  1. Is SBQQ.AbstractDAO.deleteByIds() expected CPQ behavior during Quote Sync, Amendments, or Renewals?
  2. What is the best way to confirm exactly which records are being deleted by CPQ (OpportunityLineItem vs QuoteLine vs Subscription)?
  3. Has anyone successfully implemented logic to protect historical Opportunity Products without breaking CPQ synchronization?
  4. Is there a recommended CPQ pattern for retaining historical OLIs while still allowing Quote Sync to update current Opportunity Products?
  5. Are there any Salesforce CPQ documented behaviors showing when OLIs are deleted/recreated during sync? 

     

    Any guidance, documentation references, or real-world implementation patterns would be greatly appreciated.

#Salesforce CPQ & Billing

2 risposte
  1. 6 ago, 11:59

    hi @Deepika Khanna

     

    Thanks for your input. Based on the debug logs, the database deletion is first executed by the Salesforce CPQ managed package through: 

    Class.SBQQ.AbstractDAO.deleteByIds: line 237, column 1: 

    com.salesforce.api.Database.delete(List<SObject>, Boolean) 

    This is immediately followed by: 

    Class.SBQQ.QuoteOpportunitySynchronizer.clearOpportunityLineItemsByLineItemId:Delete: List<OpportunityLineItem> 

    These log entries confirm that Salesforce CPQ's Quote-to-Opportunity synchronization process is deleting Opportunity Line Items (OLIs) that no longer have a corresponding Quote Line. The deletion is performed by standard managed package logic and not by custom Apex code. 

    During synchronization, QuoteOpportunitySynchronizer determines obsolete Opportunity Products and invokes the managed package deletion framework (SBQQ.AbstractDAO.deleteByIds) to remove them from the database. Therefore, the observed OLI deletion is expected CPQ synchronization behavior when reconciling Opportunity Products with the current Quote configuration. 

    As you mentioned, To preserve historical product information, preferred approach is to implement an OLI archival solution using a custom history object rather than attempting to prevent CPQ from deleting obsolete OLIs.

0/9000