Welcome to Zuora Product Documentation

Explore our rich library of product information

Error logging for Opportunity Product sync

Learn how Opportunity Product Sync logs errors and status in Salesforce, how to query those logs, and how to troubleshoot and monitor sync health.

When you use Opportunity Product Sync in Zuora CPQ X (Release 10.58+), errors and status information are written to specific Salesforce objects. Use these logs to monitor sync health, diagnose failures, and build reports or dashboards.

Opportunity Product Sync writes to two primary locations:

LocationObject (API name)PurposeRetention
Quote-level status fieldszqu__Quote__cStores per-quote sync status, most recent error message, timestamp, and version. This is the primary place to check a specific failed quote.Persistent on the Quote record (fields are overwritten on each sync attempt).
Central CPQ X error logzqu__Log__cStores detailed error records, including stack traces, method names, and user context for all CPQ X operations, including Opportunity Product Sync.Controlled by Zuora_Config__c.Retention_Days__c for error logs; Info-level logs are automatically purged after 2 days.

Quote-level sync status on zqu__Quote__c

Every Opportunity Product Sync attempt updates dedicated status and audit fields on the Quote (zqu__Quote__c) record. These fields are the first place to look when a quote fails to sync.

Quote-level status fields

The following fields track per-quote sync state and metadata:

Field (API name)LabelTypeDescription
zqu__OppProdSyncStatus__cOpportunity Product Sync StatusPicklistCurrent lifecycle state of the sync for this quote.
zqu__OppProdSyncError__cOpportunity Product Sync ErrorLong Text Area (32,768 chars)Error message from the most recent failed sync attempt. This field is cleared on a successful sync.
zqu__OppProdSyncLastDateTime__cOpportunity Product Sync Last Date TimeDateTimeTimestamp of the most recent sync attempt, whether it succeeded or failed.
zqu__OppProdSyncVersion__cOpportunity Product Sync VersionNumberIncremented on each successful sync, starting at 1.

Status values

Use the Opportunity Product Sync Status field to quickly understand where a quote sits in the sync lifecycle and what action is required.

StatusMeaningAction required
Not StartedSync has never run for this quote.None. This is the initial state.
QueuedAuto-sync has been dispatched, but the batch job has not started yet.Wait. The sync will start shortly.
Sync PendingThe batch job is enqueued and actively processing.Wait. The sync is in progress.
CompletedSync finished successfully.None.
FailedSync encountered an error.Review zqu__OppProdSyncError__c on the Quote for details, then resolve and retry.
Blocked - Sent to BillingThe quote has already been sent to Z-Billing. Sync is not allowed to avoid divergence.No action on sync. This is expected behavior after Send to Zuora to prevent divergence between forecasts and billed data.
Waiting for Charge SegmentsCharge segments do not yet exist for this quote (Order Preview has not completed).Run Order Preview and wait for charge segment generation to complete, then retry sync.

Example SOQL queries for quote-level status

Use the following SOQL examples in Developer Console, Workbench, or the Salesforce API to find quotes by sync status.

Find all failed quotes

SELECT Id,
       Name,
       zqu__OppProdSyncStatus__c,
       zqu__OppProdSyncError__c,
       zqu__OppProdSyncLastDateTime__c,
       zqu__OppProdSyncVersion__c,
       zqu__Opportunity__c
FROM   zqu__Quote__c
WHERE  zqu__OppProdSyncStatus__c = 'Failed'
ORDER BY zqu__OppProdSyncLastDateTime__c DESC

Find sync status for a specific quote

SELECT Id,
       Name,
       zqu__OppProdSyncStatus__c,
       zqu__OppProdSyncError__c,
       zqu__OppProdSyncLastDateTime__c,
       zqu__OppProdSyncVersion__c
FROM   zqu__Quote__c
WHERE  Id = '<QUOTE_ID>'

Find quotes stuck in non-terminal states

Use this query to detect quotes that may have stalled in Queued or Sync Pending for more than approximately two hours.

SELECT Id,
       Name,
       zqu__OppProdSyncStatus__c,
       zqu__OppProdSyncLastDateTime__c
FROM   zqu__Quote__c
WHERE  zqu__OppProdSyncStatus__c IN ('Queued', 'Sync Pending')
AND    zqu__OppProdSyncLastDateTime__c < LAST_N_HOURS:2
ORDER BY zqu__OppProdSyncLastDateTime__c ASC
Note:

Quotes stuck in Queued or Sync Pending for more than about two hours can indicate a failed asynchronous job. Retry syncing those quotes manually.

Central error log (zqu__Log__c)

Backend errors from all CPQ X operations, including Opportunity Product Sync, are written to the custom object zqu__Log__c via the platform event zqu__Log_Event__e. This is the shared CPQ X error log used across multiple components.

Log__c fields

zqu__Log__c records are created only when Error Logging is enabled and configured in Quote Configuration Settings > Advanced Quoting Configuration Settings. If it is disabled, Quote Studio does not generate any zqu__Log__c records for Opportunity Product Sync or other operations.

The following fields are relevant when troubleshooting Opportunity Product Sync failures:

Field (API name)LabelTypeDescription
zqu__Error_Message__cError MessageText AreaShort error description, truncated to 250 characters.
zqu__Stack_Trace__cStack TraceLong Text AreaFull Apex stack trace for debugging.
zqu__Method_Name__cMethod NameTextApex class and method that logged the error (for example, ChargeSegmentOppProdSyncBatch:execute).
zqu__Parent_Id__cParent IdTextRelated record ID. For Opportunity Product Sync errors, this is typically the Quote ID.
zqu__Log_Level__cLog LevelPicklistLog level: Error, Info, or Debug.
zqu__User_Id__cUser IdTextSalesforce User ID of the user whose action triggered the error.
zqu__Details__cDetailsLong Text AreaAdditional context for Info-level logs.
zqu__Duration__cDurationNumberProcessing duration in milliseconds (Info logs only).
zqu__Keep__cKeep?CheckboxWhen selected, prevents automatic cleanup of this log record. Default is false.
CreatedDateCreated DateDateTimeStandard field that stores when the log record was created.

Example SOQL queries for Opp Prod Sync errors

Find all Opportunity Product Sync errors

The Opportunity Product Sync components log errors using distinctive method names. Use those values in filters to find relevant entries.

SELECT Id,
       CreatedDate,
       zqu__Error_Message__c,
       zqu__Stack_Trace__c,
       zqu__Method_Name__c,
       zqu__Parent_Id__c,
       zqu__User_Id__c
FROM   zqu__Log__c
WHERE  zqu__Log_Level__c = 'Error'
AND   (zqu__Method_Name__c LIKE '%OppProdSync%'
       OR zqu__Method_Name__c LIKE '%ChargeSegmentOppProdSync%')
ORDER BY CreatedDate DESC

Find errors for a specific quote

Use this query to retrieve errors associated with a particular quote.

SELECT Id,
       CreatedDate,
       zqu__Error_Message__c,
       zqu__Stack_Trace__c,
       zqu__Method_Name__c
FROM   zqu__Log__c
WHERE  zqu__Quote__c = '<QUOTE_ID>'
AND    zqu__Log_Level__c = 'Error'
ORDER BY CreatedDate DESC

Known method names for Opp Prod Sync errors

The following values commonly appear in zqu__Method_Name__c for Opportunity Product Sync log entries. They help you identify the component that raised the error.

Method nameComponentWhen it fires

ChargeSegmentOppProdSyncBatch:execute

Batch job

Error during the actual sync processing of a quote.

ChargeSegmentOppProdSyncBatch:finish

Batch job

Aggregated error summary logged at the end of the batch.

OppProdSyncExecutionService.requestSyncForQuotes

Execution service

Quote is rejected during enqueue validation.

OppProdSyncAutoSyncService.requestSyncBeforeQuotesSentToZuora

Auto-sync (Submit to Zuora)

Error during the Submit to Zuora auto-sync path.

OppProdSyncAutoSyncService.enqueueAfterSubmitExitFromStudio

Auto-sync (Submit & Exit)

Error during the Submit & Exit Studio auto-sync path.

OppProdSyncAutoSyncService.writeErrorToQuote

Auto-sync

Failed to write error status back to the quote.

OppProdSyncRequestQueueable.execute

Queueable job

Error in the asynchronous queueable job that dispatches the batch.

OppProdSyncGlobalService.syncQuotes

Global service

Error triggered by programmatic or global API callers.

Sync audit trail object (zqu__OppProdSyncRecord__c)

The zqu__OppProdSyncRecord__c junction object stores the audit trail of successful Opportunity Product Sync operations. It is not an error log. Each record links a Quote to a synced Opportunity Product (OpportunityLineItem) and stores metadata about how charge segments were grouped.

Example SOQL queries for sync audit records

Find sync records for a quote

SELECT Id,
       Name,
       zqu__OpportunityProduct__c,
       zqu__Quote__c,
       zqu__ChargeSegmentGroupingKey__c,
       zqu__SegmentCount__c,
       zqu__SegmentEarliestStartDate__c,
       zqu__SegmentLatestEndDate__c,
       zqu__SyncDateTime__c,
       zqu__TotalDeltaQuantity__c
FROM   zqu__OppProdSyncRecord__c
WHERE  zqu__Quote__c = '<QUOTE_ID>'
ORDER BY zqu__SyncDateTime__c DESC

Find which quote synced a specific Opportunity Product

SELECT Id,
       zqu__Quote__c,
       zqu__SegmentCount__c,
       zqu__SyncDateTime__c,
       zqu__ChargeSegmentGroupingKeyFull__c
FROM   zqu__OppProdSyncRecord__c
WHERE  zqu__OpportunityProduct__c = '<OPPORTUNITY_LINE_ITEM_ID>'

Building Salesforce reports

You can build Salesforce reports and dashboards on top of the quote-level fields, logs, and sync audit records to monitor Opportunity Product Sync health.

  • Report: Failed Opportunity Product Syncs

  • Report: Opportunity Product Sync error log

  • Report: Sync audit trail (successful syncs)

Dashboard idea: Opportunity Product Sync health

You can combine the reports mentioned in the above section into a dashboard to monitor overall health:

  • KPI: Count of quotes with Failed status in the last 7 days.

  • KPI: Count of quotes with Completed status in the last 7 days.

  • Table: Top 10 most recent failures with error messages.

  • Chart: Overall sync status distribution (for example, a pie chart of all status values).

Common scenarios and solutions

Error message (or pattern)CauseResolution
Quote must be linked to an Opportunity.The Quote does not have an Opportunity lookup populated.Link the quote to an Opportunity, then retry Opportunity Product Sync.
Cannot sync a quote that has been sent to Z-Billing.The quote has already been submitted to Zuora; sync is intentionally blocked.This is expected behavior. Perform Opportunity Product Sync before you send the quote to Zuora.
Charge segments are not valid after the latest order preview; complete metrics processing before syncing.Order Preview has not completed, or charge segments have not been generated.Run Order Preview on the quote and wait for charge segment generation to complete, then retry sync.
Only the primary Quote may sync to opportunity products. For MSQ, run sync from the primary (parent) quote.Sync was attempted on a non-primary quote or an MSQ child quote.Run Opportunity Product Sync from the primary quote for the Opportunity.
A sync is already in progress for this quote.Duplicate sync request while a sync is already running for this quote.Wait until the current sync has completed before retrying.
Opportunity Product Sync is not enabled for this org.Opportunity Product Sync is not enabled in the org configuration.Enable the feature in Opportunity Product Sync Settings within Quote Studio Settings. An LMO license is required.
User does not have CREATE access on OpportunityLineItem...The running user does not have create permission or field-level access on OpportunityLineItem or mapped fields.Grant CREATE permission on OpportunityLineItem and ensure all mapped custom fields are accessible via profile or permission sets.
Field mapping configuration error: ...A required field mapping failed field-level security validation.Review field mapping settings and confirm that the mapped Opportunity Product custom fields exist and are accessible.
Could not queue Opportunity Product Sync: insufficient asynchronous Apex capacity...Salesforce asynchronous Apex job limits were reached in the current transaction.Save the record again or retry the sync later, after async capacity becomes available.
SHA-256 collision detected for key: ...Extremely rare hash collision detected in grouping keys.Contact Zuora Support. This may require reconfiguring grouping keys.

Log retention and cleanup

Error and information logs are cleaned up automatically according to configuration and log level.

  • Error logs (Log_Level__c = 'Error'): Retained for the number of days set in Zuora_Config__c.Retention_Days__c.

  • Info logs (Log_Level__c = 'Info'): Automatically purged after 2 days.

  • Keep flag: Setting Keep__c = true on a zqu__Log__c record prevents that record from being deleted by the cleanup job.

  • Cleanup job: The scheduled batch LogCleanupBatch purges old zqu__Log__c records based on the retention configuration.

Note:

If you need to preserve logs for a particular investigation, set Keep__c = true on the relevant zqu__Log__c records before the cleanup job runs.

Common fixes checklist

Use this checklist as a practical flow when you investigate an Opportunity Product Sync issue.

  1. Check the Quote first

    On the Quote record, review zqu__OppProdSyncStatus__c and zqu__OppProdSyncError__c for the immediate error context.

  2. Check the central log (zqu__Log__c)

    Query zqu__Log__c, filtered by the Quote ID in zqu__Parent_Id__c, to get full stack trace and method details.

  3. Verify logging is enabled

    Confirm that Zuora_Config__c.Enable_Logging__c is set to true. If it is false, CPQ X does not write any zqu__Log__c records.

  4. Check prerequisites

    • Feature enabled: Confirm Opportunity Product Sync is enabled (for example, zqu__OppProdSyncConfig__c.IsEnabled__c).

    • Charge segments exist: Ensure the quote has generated charge segments (run Order Preview first).

    • Primary quote: For multi-quote scenarios (MSQ), confirm the quote is the primary quote on the Opportunity.

    • Billing state: Check whether the quote has already been sent to Billing (Send to Zuora). Sync is blocked once the quote has been sent.

  5. Check permissions.

    Verify that the running user has CREATE access on OpportunityLineItem and on all custom fields referenced in field mappings.

  6. Retry the sync

    For transient or capacity-related failures, use the Sync Opportunity Products quick action again on the Quote record page after you have addressed the root cause.