--- title: "Prerequisites & Apex, Flow, or manual methods" slug: "pré-requis-méthodes" updated: 2026-08-20T15:18:13Z published: 2026-08-20T15:18:13Z canonical: "help.frisbii.com/pré-requis-méthodes" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.frisbii.com/llms.txt > Use this file to discover all available pages before exploring further. # Prerequisites & Apex, Flow, or manual methods 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. ![](https://cdn.document360.io/b84e1b5d-2ba6-4465-8c62-fb45a2f31314/Images/Documentation/image-8V5RFAIU.png?sv=2026-02-06&spr=https&st=2026-10-27T23%3A39%3A14Z&se=2026-10-28T00%3A39%3A14Z&sr=c&sp=r&sig=lp7jU2yGGLsyHn7QtMEGgM6fkGWb90w5NmqPqUHcH1E%3D) ## Prerequisites before generating Before you can use the e-invoice features, check the following points: - The **Frisbii e-invoice** extension package is installed in your Salesforce org. - Your Frisbii app version is **≥ 3.247**. - The **"Frisbii E-Invoicing" Permission Set** is assigned to the relevant users (see below). - Your [customer database is qualified](/frisbii-app/docs/en/préparer-votre-base-de-données-clients): SIREN, SIRET, electronic billing address, customer type… - The [Region/Country (States and Territories) picklists](/frisbii-app/docs/en/pré-requis) are enabled on your Salesforce org. ## 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**. ![](https://cdn.document360.io/b84e1b5d-2ba6-4465-8c62-fb45a2f31314/Images/Documentation/image-ZJ6VI75E.png?sv=2026-02-06&spr=https&st=2026-10-27T23%3A39%3A14Z&se=2026-10-28T00%3A39%3A14Z&sr=c&sp=r&sig=lp7jU2yGGLsyHn7QtMEGgM6fkGWb90w5NmqPqUHcH1E%3D) 2. Click the action buttons sidebar and click **Add Action**. ![](https://cdn.document360.io/b84e1b5d-2ba6-4465-8c62-fb45a2f31314/Images/Documentation/image-245B4G50.png?sv=2026-02-06&spr=https&st=2026-10-27T23%3A39%3A14Z&se=2026-10-28T00%3A39%3A14Z&sr=c&sp=r&sig=lp7jU2yGGLsyHn7QtMEGgM6fkGWb90w5NmqPqUHcH1E%3D) 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. ![](https://cdn.document360.io/b84e1b5d-2ba6-4465-8c62-fb45a2f31314/Images/Documentation/image-M3819J3H.png?sv=2026-02-06&spr=https&st=2026-10-27T23%3A39%3A14Z&se=2026-10-28T00%3A39%3A14Z&sr=c&sp=r&sig=lp7jU2yGGLsyHn7QtMEGgM6fkGWb90w5NmqPqUHcH1E%3D) ### 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. ![](https://cdn.document360.io/b84e1b5d-2ba6-4465-8c62-fb45a2f31314/Images/Documentation/image-QBLRBIGP.png?sv=2026-02-06&spr=https&st=2026-10-27T23%3A39%3A14Z&se=2026-10-28T00%3A39%3A14Z&sr=c&sp=r&sig=lp7jU2yGGLsyHn7QtMEGgM6fkGWb90w5NmqPqUHcH1E%3D) ![](https://cdn.document360.io/b84e1b5d-2ba6-4465-8c62-fb45a2f31314/Images/Documentation/image-5NHNBXBZ.png?sv=2026-02-06&spr=https&st=2026-10-27T23%3A39%3A14Z&se=2026-10-28T00%3A39%3A14Z&sr=c&sp=r&sig=lp7jU2yGGLsyHn7QtMEGgM6fkGWb90w5NmqPqUHcH1E%3D) > 💡 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. --- ## 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 ```plaintext 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 ```plaintext List ids = new List{    '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: ```plaintext 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. ### B2B Router — The recommended tester [**B2B Router**](https://app.b2brouter.net/fr/validation) 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://app.b2brouter.net/fr/validation](https://app.b2brouter.net/fr/validation) 4. Upload your XML file. 5. 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.](/frisbii-app/docs/en/connexion-à-la-community)