Enabling Expense Import
JustOn Billing & Invoice Management creates expenses from inbound electronic invoices (XML files) and PDF files. Basically, there are two options to register expenses: using an email service or via manual upload and import.
Depending on how your business handles incoming e-invoices, the configuration may involve
- Enabling the expense email service
- Enabling the manual expense import
- Configuring the display of processing logs
- Enabling Azure Document Intelligence for PDF parsing
For information on allowing graphical representations for expenses, see Enabling Expense Visualization.
Enabling Expense Email Service
JustOn Billing & Invoice Management can create expenses from inbound electronic invoices (XML files) and PDF files. It automatically processes incoming invoice files received by email.
To this end, the software provides the Apex class EInvoiceEmailService. This class is to be called using a dedicated Salesforce email services.
Expense email service concepts and limitations
JustOn Billing & Invoice Management processes the received invoice file:
- E-invoice XML files are validated against the e-invoice standard
- PDF files are sent to the Azure Document Intelligence service for data extraction
On successful processing, the software creates the according expense in the status Accrued and the related expense items.
The following limitations apply:
- General behavior
-
- For best results, make sure to attach one invoice file per email (XML or PDF).
- With XML and PDF attachments in one email, XML files take precedence over PDF files.
- With multiple XML attachments or multiple PDF attachments without XML, JustOn Billing & Invoice Management creates an empty fallback expense record with the given files attached.
- Any other files (JPG, PNG, CSV, etc.) will be attached to the created expense record.
- XML file requirements
-
- File extension:
.xml - MIME type:
application/xmlortext/xml - In case of a validation failure, JustOn Billing & Invoice Management will create a fallback expense with the e-invoice status
Validation Error.
- File extension:
- PDF file requirements
-
- Requires Azure Document Intelligence integration
- File extension:
.pdf - Without a configured Azure DI integration or in case of a parsing failure, JustOn Billing & Invoice Management will create a fallback expense with the type
Undefined.
If a submitted file fails processing, the file and the additional attachments will be saved with an empty fallback expense. This allows users to process the retrievable information manually.
To configure the expense email service:
- Click to enter Setup, then navigate to Custom Code > Email Services.
- Click New Email Service.
-
Specify the details as required.
The minimum required fields include:
- Email Service Name
- Apex Class:
EInvoiceEmailService - Accept Attachments:
All - Active:
true

-
Click Save and New Email Address.
-
In the
Email Addressfield, specify the local part of the email service address.Salesforce will generate the unique domain part for the email service address. For details, see Define Email Service Addresses.
-
Click Save.
This enables the email service to receive invoices and transform them into expenses. Consequently, JustOn Billing & Invoice Management will process emailed invoice files (XML or PDF) and, on successful processing, create the according expenses and expense items.
Info
JustOn recommends not to disclose the generated email service address to prevent misuse. Instead, use a different email address for external access and set up a (filtered) redirection – either automatically or manually by users.
Enabling Manual Expense Import
For users to be able to upload invoice files (XML or PDF), you must add the Import Expense button to the Expense list view.
- Navigate to the object management settings of the Expense object.
- Click List View Button Layout.
- In the List View row, click , then select Edit.
-
Under Custom Buttons, move
Import Expenseto the Selected Buttons column. -
Click Save.
This adds the button Import Expense to the Expense list view, enabling users to upload invoice files (XML or PDF) for import.
List View Button Layout not visible?
Under certain circumstances, the option List View Button Layout may not be visible. In this case, make sure that the Expense object is searchable.
- Navigate to the object management settings of the Expense object.
- Click Details > Edit.
- In the Search Status section, select
Allow Search. - Click Save.
Configuring Processing Log Display
Users may require to easily assess the processing logs for imported expenses. To this end, JustOn Billing & Invoice Management provides the dedicated page component processingLogViewer, which you can, optionally, add to the Expense record page.
This component
- reads and displays the processing log JSON file attached to the expense
- provides a formatted view of the processing events with expandable details
- shows status indicators (success, warning, error) for each event
Manually created expenses will display No processing log found.
To add the component to the page:
-
Open the Expense record detail page in the Lightning App Builder.
- Navigate to an expense.
- Click to open the Setup menu, then select Edit Page.
-
Modify the page layout.
Drag the
processingLogViewercomponent (under Custom - Managed) to an appropriate region of the record page.
-
Optionally, adjust the component title via
titleLabelproperty. - Click Save.
-
Click Activate.
This makes the customized record page available to users, enabling them to easily assess the processing logs for imported expenses.
For more details about editing Lightning pages, see Create and Configure Lightning Experience Record Pages in the Salesforce Help.
Enabling Azure Document Intelligence
JustOn Billing & Invoice Management can integrate with Azure Document Intelligence to have invoice data extracted from PDF files.
Info
Azure Document Intelligence is a paid service (with a free tier). Before you can use Azure Document Intelligence with JustOn Billing & Invoice Management, your organization must sign up for an Azure account with Microsoft.
Enabling Azure Document Intelligence with JustOn Billing & Invoice Management involves the following steps:
- Creating an Azure account
- Creating a Document Intelligence resource
- Retrieving the Azure DI credentials
- Activating Azure DI in JustOn Billing & Invoice Management
Creating Azure Account
To create an Azure account with Microsoft:
-
Navigate to Create Your Azure Free Account Or Pay As You Go | Microsoft Azure.
JustOn recommends to select the Pay as you go option. There is a free quota of 500 pages per month; beyond that, usage-based pricing applies (see Azure Document Intelligence in Foundry Tools pricing).
-
Click Sign up and follow Microsoft's instructions.
Creating Document Intelligence Resource
In order to use Azure Document Intelligence, you need a resource, a dedicated service instance. To create it:
- Sign in to Azure.
- On the Azure home page, click Create a resource.
- In the search bar, search for and select
Document Intelligence. -
Click Create and follow Microsoft's instructions.
For details, see Create a Document Intelligence resource in the Microsoft Azure documentation.
Retrieving Azure DI Credentials
To connect JustOn Billing & Invoice Management with your Document Intelligence resource, you need its key and endpoint URL. To get these values:
- In the Azure portal, open your Document Intelligence resource.
- Navigate to Resource Management > Keys and Endpoint.
-
Copy the values from
KEY 1andEndpointto a convenient location.For details, see Get endpoint URL and keys in the Microsoft Azure documentation.
Activating Azure Document Intelligence
To activate Azure Document Intelligence, you enter your DI resource credentials in the Azure configuration page in JustOn Billing & Invoice Management. To do so:
- Click to access the App Launcher, and select JustOn Billing Configuration.
- Open the Azure tab.
-
In the Azure Document Intelligence Credentials section, enter your DI resource credentials copied before.
Field Description Endpoint Your Azure endpoint URL, like https://<resource-name>.cognitiveservices.azure.comSubscription Key Your Azure API key (from KEY 1) -
Click Test Connection to test the connection to Azure Document Intelligence.
This checks the connection with the currently stored credentials.
-
Click Save.
This saves the current configuration and immediately activates the invoice data extraction from uploaded PDF files.