Loading
PHP Vulnerability Monitoring Read More
Set Up Trade Promotion Management
Troubleshoot Processes

Troubleshoot Processes

Troubleshoot errors and fix issues that prevent your business processes from completing.

Troubleshoot Stuck Claims

Diagnose and fix version mismatches caused by manual edits or custom automations that prevent claims from progressing from ToBeClosed to Closed status after successful batch runs.

After multiple batch calculation cycles, claims can persist in the ToBeClosed status without progressing even under these conditions:

  • Batch Run Status indicates completion with no errors.
  • The claim record and chatter feed have no error notifications.
  • The claim calculation service runs successfully in every cycle.

The claim calculation service maintains data integrity by using the version control fields cgcloud__Version__c and cgcloud__Offplatform_Version__c.

To prevent data loss, the system bypasses the closing operation if it identifies a version mismatch. A mismatch typically occurs when the claim record is updated manually or through custom automations, such as Apex triggers, Process Builder, or flows, while the calculation service handles it.

Because the system categorizes these instances as acknowledged meaning the calculation was completed but the results were withheld from the record, they don’t trigger error flags in the Batch Run Status. If underlying automations continue to modify the records during each calculation cycle, the version mismatch recurs, leaving the affected claims stuck in their current state.

Diagnose a Version Mismatch

To confirm a version mismatch for stuck claims, perform the following steps:

  • To export stuck claims, run this SOQL query in the Developer Console:

    SELECT Id, Name, cgcloud__Payment_Status__c, 
                cgcloud__Offplatform_Version__c, cgcloud__Version__c
                FROM cgcloud__Payment__c
                WHERE cgcloud__Payment_Status__c = 'ToBeClosed'
  • Check the exported records to verify whether a version mismatch exists. A mismatch occurs if the cgcloud__Version__c field value is exactly one increment higher than the cgcloud__Offplatform_Version__c field value across all problematic claims.

    For example:

    • cgcloud__Offplatform_Version__c: 5
    • cgcloud__Version__c: 6

    This pattern indicates that an external process modified the claim after the calculation service read it but before the service saved the result.

  • Review custom automations that modify claim records.

    • From Setup, in the Quick Find box, enter Flows, and then select Flows. Search for active flows that update claim records.

    • From Setup, in the Quick Find box, enter Process Builder, and then select Process Builder. Review active processes on the Claim object.

    • Check for custom Apex triggers on cgcloud__Payment__c that run on update operations.

    • Look specifically for automations that update claim fields when the status is ToBeClosed.

Resolution

To resolve the issue of stuck claims, run this anonymous Apex snippet within the Developer Console:

List<cgcloud__Payment__c> stuck = [
    SELECT Id FROM cgcloud__Payment__c
    WHERE cgcloud__Payment_Status__c = 'ToBeClosed'
    AND cgcloud__Version__c = cgcloud__Offplatform_Version__c + 1
];
update stuck;

This operation activates the version handler to synchronize version identifiers. The claims then move to the Closed status during the next scheduled claim calculation cycle.

 
Loading
Salesforce Help | Article