Loading

NPSP RD2_OpportunityEvaluation_BATCH throws "List index out of bounds: 0" on nightly run for Lapsed Recurring Donations

Veröffentlichungsdatum: Jul 29, 2026
Beschreibung

Orgs using NPSP Enhanced Recurring Donations (RD2) run a nightly batch job (npsp__RD2_OpportunityEvaluation_BATCH) that evaluates Lapsed Recurring Donations for Status Automation. When any Lapsed Recurring Donation has a Schedule End Date earlier than its Effective Date, the batch job's date math fails and throws:

"Batch Apex error — First error: List index out of bounds: 0" Context: npsp__RD2_OpportunityEvaluation_BATCH

This error is generated by bad data — specifically, Recurring Donation records where:

 

  • npsp__EndDate__c (Schedule End Date) < npsp__StartDate__c (Effective Date)
  • The record is in Lapsed status (making it eligible for nightly batch evaluation)

This pattern is commonly introduced by third-party fundraising integrations (such as Fundraise Up) that create Recurring Donations without validating the date order. Each new record with inverted dates will trigger the error on the following nightly run.


NPSP is working as designed — it is correctly raising on malformed input data.

Lösung

Immediate fix (stop the nightly error emails):

  1. Identify the Lapsed Recurring Donation(s) with inverted dates. You can find them by querying for records where Status = Lapsed and Schedule End Date is not blank:
    1. Review each Lapsed record's Effective Date and Schedule End Date fields
    2. The problematic pattern is: End Date is an earlier date than the Effective Date
  2. For each affected record:
    1. Open the Recurring Donation record
    2. Change Status from Lapsed to Closed
    3. Set a Closed Reason (e.g., "Schedule error — data integrity")
    4. Save
  3. After closing the affected records, the nightly batch will run clean.

Long-term fix (prevent recurrence):
If the records were created by a third-party integration, escalate to the integration vendor to add date validation — specifically, the integration should never set npsp__EndDate__c to a date earlier than npsp__StartDate__c when creating Recurring Donation records.

Nummer des Knowledge-Artikels

005387169

 
Laden
Salesforce Help | Article