We are implementing a deployment freeze on the following dates: Nov 20th - Dec 2nd and Dec 18th - Jan 4th

Prerequisites & Apex, Flow, or manual methods

Prev Next

Frisbii e-invoice generates invoices in XML CII (Cross Industry Invoice) Extended format, the standard chosen by Frisbii among the reform's 3 base formats. If you choose your own Approved Platform, make sure it accepts this format — and familiarise yourself with its structure for your tests. This guide covers the two available methods: manual generation from an invoice, and bulk generation via Apex or Flow.

Prerequisites before generating

Before you can use the e-invoice features, check the following points:

Assign the Frisbii E-Invoicing Permission Set

The Frisbii E-Invoicing permission set controls access to the electronic invoicing features. It must be assigned to every user who needs to generate or view electronic invoices.

To assign it:

  1. Go to Setup → Permission Sets.

  2. Select Frisbii E-Invoicing.

  3. Click Manage Assignments → Add Assignments.

  4. Select the relevant users and save.

⚠️ Without this permission set, the generation button and e-invoice fields will not be visible to the user, even if the package is installed.

Conditions for CII generation

To be able to generate an XML invoice from Frisbii, here are the preliminary conditions:

  • The invoice must be issued

  • The invoice must include at least one invoice line

  • A valid SIREN must be present on the customer Account and on the issuing legal entity

  • The Region/Country (States and Territories) picklists must be enabled on your Salesforce org

Method 1 — Manual generation from an invoice (button)

This is the simplest method, suited to case-by-case use or your initial tests.

Add the E-Invoice XML button to your Invoice page layout

The generation button isn't added automatically to your page layout during installation. You need to add it manually once.

  1. From any Frisbii invoice, click the Setup icon (⚙️) in the page header, then select Edit Page.

  2. Click the action buttons sidebar and click Add Action.

  3. In the list of actions, search for and select E-Invoice XML.

  4. Click Save, then make sure the page is properly activated for your user profiles. Without activation, the button won't be visible.

Generate the CII from an invoice

Once the button is in place:

  1. Open the Frisbii invoice for which you want to generate the XML.

  2. Click the E-Invoice XML button in the action bar.

  3. The XML CII file is generated and automatically attached to the invoice in the Notes & Attachments section.

💡 You can download the XML file from Notes & Attachments and open it in a text editor to check the data. This is especially useful during your testing phases.

Generate e-invoices in bulk from the Invoice list view

In addition to the E-Invoice XML button available on an invoice record, Frisbii e-invoice provides a button with the same name on the invoice list view. It lets you select several invoices and generate their e-invoice (CII XML) in a single action, without using Apex or a Flow.

ℹ️ Good to know: like the button on the invoice record, this button is not added automatically when the package is installed. An administrator needs to add it once.

Add the button to the list view

  1. Go to Setup → Object Manager.

  2. Search for and open the Invoice object.

  3. In the left-hand menu, click List View Button Layout.

  4. On the List View row, click the arrow on the right, then Edit.

  5. In the Custom Buttons section, select E-Invoice XML in Available Buttons, then click the Add arrow to move it to Selected Buttons.

  6. Click Save.

⚠️ Warning: Salesforce does not display mass action buttons on the Recently Viewed list view. Use another list view (for example All Invoices) or create a dedicated one.

Generate CIIs from the list view

  1. Open the Invoices tab and choose a list view.

  2. Select the relevant invoices.

  3. Click E-Invoice XML in the button bar.

  4. The XML for each invoice is generated and added to the Notes & Attachments of the corresponding invoice.

💡 Tip: create a list view filtered on the invoices to process (status Issued, billing country France, no E-reporting Category Code) to quickly find the relevant B2B invoices.


Method 2 — Bulk generation via Apex

To process a large volume of invoices in a single operation, Frisbii e-invoice exposes a dedicated Apex method.

The method

fiix.EInvoicingService.saveXmlsAsFilesFromInvoiceIds(invoicesIds, isPdfToAttach);

Arguments

Parameter

Type

Description

invoicesIds

List<Id>

List of Salesforce record IDs of the invoices to process

isPdfToAttach

Boolean

If true, each invoice's PDF is Base64-encoded and attached to the CII as an AdditionalReferencedDocument (BT-125)

What the method does

For each invoice in the list, the method:

  1. Generates the corresponding XML CII file.

  2. Saves it as a ContentDocument (Salesforce File).

  3. Links the file to the invoice record in its Notes & Attachments list.

Important notes on processing

⚠️ Asynchronous (batch) processing beyond 25 invoices. If the input list contains more than 25 invoices, processing automatically switches to asynchronous batch mode. The limit is set by the Salesforce platform in a batch context with QueryLocator.

⚠️ Batch processing from 8 invoices when custom mappings are used. If you have defined custom mappings on the EInvoicing Mappings page, batch mode activates from 8 invoices or more in the input.

⚠️ If an error occurs, the batch of invoices is not blocked. Only the invoice with the error is isolated, and its submission status changes to “Failed,” but the other invoices continue to be generated.

Example call from the developer console

List<Id> ids = new List<Id>{
    'a0XXXXXXXXXXXXXXX',
    'a0YYYYYYYYYYYYYYY'
};
fiix.EInvoicingService.saveXmlsAsFilesFromInvoiceIds(ids, true);

Method 3 — Bulk generation via Flow (Invocable method)

The equivalent of the Apex method is available for Salesforce Flows, without needing any code.

In your Flow, add an Action element and search for the action:

Generate e-invoicing XMLs from Invoice records to Files

The parameters are identical to the Apex method: the list of invoice record and the boolean for attaching the PDF.

From this workflow, you’ll be able to define your input conditions, such as:

  • E-invoicing applies only to B2B invoices between French taxable entities; therefore, only invoices where the billing country is France should be generated (this is an example—you can choose another criterion, such as the presence of a SIREN/SIRET number on the account…)

  • Do not include e-reporting; if an invoice has the “E-reporting Category Code” field, then no XML should be generated for that invoice

  • Do not include invoices of the “Internal Credit Memo” type. The Reform specifies that in the event of a refusal or rejection of an electronic invoice, an internal credit memo must be issued but not submitted to the PA; this is solely an internal accounting document.

💡 This method is ideal for automating CII generation whenever an invoice's status changes (e.g. an automatic trigger when an invoice moves to "Finalised" or "Issued" status).

Testing your electronic invoice

Before connecting your PA, or while waiting for the Ecosio interconnection to be deployed, you can validate your generated CII files directly using an online tool.

FNFE — The recommended tester

FNFE validator is an e-invoicing test platform that lets you validate an XML CII file, without needing a PA.

How to test:

  1. Generate a CII from a test invoice in your Frisbii sandbox (manual method via the button).

  2. Download the XML file from the invoice's Notes & Attachments.

  3. Go to https://services.fnfe-mpe.org/

  4. First connexion? Create an account.

  5. Upload your XML file.

  6. B2B Router analyses the file and reports compliance errors or warnings.

💡 This is the tool to use during your acceptance testing phase, before connecting your PA. Each error reported by B2B Router corresponds to a field that's missing or incorrectly filled in on your invoice or in your Salesforce database. You can report any errors you encounter by opening a Frisbii support ticket.

Have you signed up for the Frisbii x Ecosio offer?

Ecosio validator is an e-invoicing test platform that lets you validate an XML CII file, without needing a PA.

How to test:

  1. Generate a CII from a test invoice in your Frisbii sandbox (manual method via the button).

  2. Download the XML file from the invoice's Notes & Attachments.

  3. Go to https://ecosio.com/fr/validateur-documents-xml-factures-electroniques-peppol/

  4. Choice the following format: “France Extended CTC CII 1.4”

  5. Upload your XML file.

  6. B2B Router analyses the file and reports compliance errors or warnings.

💡 This is the tool to use during your acceptance testing phase, before connecting your PA. Each error reported by B2B Router corresponds to a field that's missing or incorrectly filled in on your invoice or in your Salesforce database. You can report any errors you encounter by opening a Frisbii support ticket.