Loading

Billing: Cannot unallocate credit note created by Cancel and Rebill on a posted invoice

Publish Date: May 26, 2026
Description

This article explains why Salesforce Billing blocks unallocation of a credit note that was generated by Cancel and Rebill, and how to correct invoice balances when the auto-generated credit note was wrong, duplicated, or needs to be redirected to a different invoice. The exact error returned on the Credit Note Allocation Unallocate action is: "Credit Note Allocation for a credit note which was generated as a result of cancelling and re-billing an invoice cannot be cancelled". A related error appears when you try to clear or change a posted credit note line: "Updating LegalEntityReference on posted credit note line is not allowed". Customers describe this as: "The user is unable to unallocate the credit note because the invoice it is attached to has been cancelled and rebilled" and "The Credit Memo has a Posted Status so there is nothing to recover". Trigger conditions: the source invoice was in Posted status, a user clicked Cancel and Rebill on the invoice [blng__Invoice__c], and Salesforce Billing automatically created a posted Credit Note [blng__CreditNote__c] allocated in full to each invoice line to zero out the invoice balance. Any later attempt to click Unallocate on that Credit Note Allocation [blng__CreditNoteAllocation__c] is blocked. Affected scope: all Salesforce Billing editions, Salesforce Billing managed package 7.0 and later, any user profile with edit access to the Credit Note record. Salesforce Billing follows Generally Accepted Accounting Principles, which is why credit notes, debit notes, payments, and refunds cannot be deleted or unallocated once posted by the Cancel and Rebill process.

Resolution

Use the steps below based on what you are trying to accomplish. Do not attempt to delete the credit note, edit the posted credit note line, or change LegalEntityReference [blng__LegalEntityReference__c] on a posted credit note line — those actions are blocked by design.

Cause 1: You need to offset the auto-generated credit note (for example, a duplicate credit note was produced by Cancel and Rebill, or you need to redirect credit to a different invoice)

  1. Open the affected account and navigate to the Credit Note [blng__CreditNote__c] record that was auto-generated by Cancel and Rebill.
  2. Note the credit note's Balance [blng__Balance__c] and Total Amount (With Tax) [blng__TotalAmountWithTax__c].
  3. From the account, click New on the Debit Notes related list to create a Debit Note [blng__DebitNote__c]. Set the Account [blng__Account__c] to the same account as the credit note.
  4. Add a Debit Note Line [blng__DebitNoteLine__c] for each credit note line you need to offset. Set the line's Subtotal [blng__Subtotal__c] equal to the credit note line's subtotal and set the Product [blng__Product__c] lookup to match.
  5. If the credit note lines are not taxable, set Tax Rule [blng__TaxRule__c] on each debit note line to a rule where Calculate Tax (Yes/No) [blng__TaxableYN__c] is No, and leave Tax Treatment [blng__TaxTreatment__c] blank. Then change the Debit Note Status [blng__Status__c] from Draft to Posted.
  6. If the credit note lines are taxable, click Estimate Tax on the draft debit note, then click Apply Tax to post it. This is required by Known Issue KI-16308 to keep tax aligned between Salesforce Billing and the external tax engine.
  7. On the posted Debit Note, click Allocate. From the Credit Notes list, select the auto-generated credit note's lines and enter amounts equal to each credit note line balance.
  8. Click Allocate. The credit note balance is now zero and is fully offset by the debit note.
  9. To deliver credit to the customer, create a new Credit Note with the correct values and allocate it to the target invoice using the Allocate button on the new credit note.
  10. Confirm the issue is resolved by opening the original credit note and verifying that Balance [blng__Balance__c] equals 0.00, and by opening the target invoice and verifying that the new credit note appears in the Credit Note Allocations related list with the expected amount.

Cause 2: Cancel and Rebill produced two credit notes (one for total amount, one for tax) and left the invoice with a negative balance

  1. Identify both credit notes on the invoice's Credit Notes related list.
  2. Determine which credit note is the duplicate. Both will share the same Created Date and Created By.
  3. Follow steps 3–8 in Cause 1 to create an offsetting Debit Note for the duplicate credit note's lines and allocate it to that credit note.
  4. Confirm the issue is resolved by opening the invoice and verifying that Balance [blng__Balance__c] equals the expected post-rebill amount and is no longer negative.

Cause 3: The credit note's Billing Contact ID [blng__BillingContact__c] points to a deleted or merged Contact and the posted credit note cannot be edited

  1. Do not attempt to edit the Billing Contact ID on the posted credit note — Salesforce Billing blocks edits to posted credit notes for legal and accounting reasons.
  2. Create an offsetting Debit Note as described in Cause 1, steps 3–8, to reduce the credit note's balance to zero.
  3. Create a new Credit Note on the same account with a valid Billing Contact ID and the correct values, and allocate it to the target invoice.
  4. Confirm the issue is resolved by opening the new credit note and verifying that the Billing Contact ID resolves to a current Contact record, and that the credit is allocated to the intended invoice line.

Cause 4: The credit note auto-generated by Cancel and Rebill was not allocated to the invoice (rebilled invoice has no allocation)

  1. Open the page layout for Invoice Line [blng__InvoiceLine__c] and edit the Credit Note Allocations related list. Click the wrench icon, expand the Buttons section, and set the New checkbox to true. Save the layout.
  2. Open the affected Invoice Line and click New on the Credit Note Allocations related list.
  3. Populate Credit Note Line [blng__CreditNoteLine__c] with the unallocated credit note line, populate Invoice Line [blng__InvoiceLine__c], and set Amount [blng__Amount__c] to the matching balance.
  4. Save the record. Do not edit LegalEntityReference [blng__LegalEntityReference__c] on the posted credit note line — that update is blocked.
  5. Confirm the issue is resolved by opening the invoice and verifying that Balance [blng__Balance__c] equals 0.00 and that the Credit Note Allocations related list shows the new allocation.
Knowledge Article Number

005385187

 
Loading
Salesforce Help | Article