When Credit Memos are created without a native NetSuite Created From reference, the required billing reference data is missing from the outbound e-document XML. This article walks through a 4-step configuration flow to remap the originating invoice number and issue date from custom fields so your Credit Memos pass e-invoicing network validation.
💡 Tip: This article covers a specific Credit Memo field remapping use case. For foundational context on the 4-tier outbound mapping architecture in ZoneCapture (Saved Search → Mapping Record → XML Template → Main Configuration), see How to Configure Custom Field Mappings for Outbound E-Invoicing in ZoneCapture before proceeding.
Overview
When transmitting Credit Memos as electronic documents — for example, under France e-invoicing regulations, PEPPOL, UBL 2.1, or Factur-X standards — compliance rules require mandatory references to the original invoice number and the original invoice issue date. These are referred to in XML standards as the billingReference.
By default, ZoneCapture extracts this information from native NetSuite fields:
- Original invoice number: Sourced from the native NetSuite Created From: Document Number field
- Original invoice issue date: Sourced from the native NetSuite Created From: Date field
The problem
If your business process creates standalone Credit Memos without populating the native NetSuite Created From field, the generated e-document XML will be missing the mandatory <cac:BillingReference> tags. The e-invoicing network (for example, Ecosio, PEPPOL, or Chorus Pro) will reject the transaction as a result.
The solution
If you store original invoice information in custom transaction fields — for example, a free-form text field for the invoice number and a custom List/Record field to link the original invoice transaction — you can remap ZoneCapture to extract data from those custom fields. The configuration follows 4 steps in sequence:
- Duplicate and customize the source Saved Search
- Create custom e-invoicing Send Data Mapping records
- Update the e-document XML template
- Link the custom template in the ZoneCapture Main Configuration
Step-by-step configuration guide
Step 1: Duplicate and customize the source Saved Search
ZoneCapture uses a source Saved Search to query transaction values at runtime.
-
In NetSuite, locate the default source search used for billingReference (for example, ZC E-Invoicing Transaction Main Line Search).
- Click Edit to open the search.
- Navigate to the Results subtab.
- Locate the rows responsible for billingReference and update them as follows:
- Billing Reference Document ID (original invoice number): Change the source from Created From: Document Number to your custom field (for example, Origin Invoice).
-
Billing Reference Issue Date (original invoice date): If your primary originating invoice field is free-form text, NetSuite cannot join to source the transaction date. Select the custom List/Record field that links directly to the original invoice transaction (for example,
custbodydm_tb_original_zb_invoice).
- Click Save As and assign a clear, unique title (for example, ZC E-Invoicing Transaction Main Line Search Custom).
- Note the Script ID or Search ID for use in Step 2.
Important: Do not change the Custom Label on these columns. The label is the lookup key that binds the Saved Search column to the ZoneCapture mapping engine. Changing the label will break the mapping.
Step 2: Create custom Einvoice Send Data Mapping records
E-Invoice Send Data Mapping records tell ZoneCapture which Saved Search output should populate a specific placeholder variable in the XML template.
- Use the global search to pull up the Einvoice Send Data Mapping List.
- Open billingReference.invoiceDocumentReference.id in a new tab for reference, then click New to create a custom mapping record.
- Configure the Document Reference mapping:
-
Name: Add a custom suffix for identification (for example,
billingReference.invoiceDocumentReference.idCUST). - Field: Enter the exact column label from the Results subtab of the Saved Search created in Step 1, billingReference.
- Send Data Path: Enter the same value you used in Name,
- Line Type: Select Header.
-
Source Data Search: Select the custom Saved Search created in Step 1.
-
Name: Add a custom suffix for identification (for example,
- Click Save.
- Open billingReference.invoiceDocumentReference.issueDate in a new tab for reference.
- Click New again to configure the Issue Date mapping:
-
Name Code: Add a custom suffix for identification (for example,
billingReference.invoiceDocumentReference.issueDateCUST). - Field Label: Enter the exact issue date column label from the Saved Search, billingReferenceIssueDate.
- Send Data Path: Enter the same value you used in Name,
- Line Type: Select Header.
-
Source Data Search: Select the custom Saved Search created in Step 1.
-
Name Code: Add a custom suffix for identification (for example,
- Click Save.
Step 3: Update the e-document XML template
- In the NetSuite File Cabinet, locate and download the standard XML template (for example, FR_Einvoicing_Template.xml).
- Open the file in a code editor and search for the
<cac:BillingReference>or<cac:InvoiceDocumentReference>block. - Update the variable placeholders inside the tags to match the exact names of the custom mapping records created in Step 2:
- Keep all other XML structure, indentation, and surrounding tags intact.
- Save the modified file with a distinct filename (for example, FR_Einvoicing_Template_Custom.xml).
- Upload the new template to the designated ZoneCapture templates folder in the NetSuite File Cabinet.
Step 4: Link the custom template in ZoneCapture Main Configuration
- Navigate to Setup > ZoneCapture Setup > ZoneCapture Main Configuration.
- Click Edit next to your configuration record.
- Go to the E-Documents subtab.
- Locate the target country configuration (for example, France).
- In the E-Document Template field, select your newly uploaded template (FR_Einvoicing_Template_Custom.xml).
- Click Save.
Verification and testing
Before deploying to production, complete the following test steps in your Sandbox environment.
| Step | Action | Expected result |
|---|---|---|
| 1. Create test Credit Memo | Create a Credit Memo where the native Created From field is empty but your custom originating invoice fields are populated. | Transaction saves successfully. |
| 2. Generate e-document | Generate the e-document XML via ZoneCapture. | XML generates without script errors. |
| 3. Inspect XML tags | Open the generated XML and inspect <cac:BillingReference>. |
<cbc:ID> and <cbc:IssueDate> contain the values from your custom fields. |
| 4. Network dispatch | Send the test document via the Ecosio or PEPPOL test gateway. | Transaction receives an ACK / Accepted status with no structural validation errors. |
Frequently asked questions
Can I source both the invoice number and issue date from a single free-form text field?
No. A free-form text field can supply the invoice number string into <cbc:ID>, but NetSuite cannot parse a free-form string to fetch the transaction record date for <cbc:IssueDate>. Provide a custom List/Record transaction field pointing to the original invoice transaction, or a dedicated custom Date field, to populate the mandatory <cbc:IssueDate> tag.
Will this customization affect standard invoices or other transaction types?
No. Standard invoices do not require <cac:BillingReference> tags, and the modified template logic applies only to Credit Memos configured under the updated France e-document profile.