d365fo_download_free_text_invoice
Download a free text invoice report as PDF from Dynamics 365 Finance & Operations. Specify invoice ID and legal entity to retrieve the document.
Instructions
Download a free text invoice report as PDF from D365 Finance & Operations.
This is a convenience tool specifically configured for free text invoices using the FreeTextInvoiceController. Free text invoices are customer invoices that don't originate from sales orders.
To find available invoices to download, query the Customer Invoice Journal entity:
Entity name: CustInvoiceJourBiEntity
Collection name: CustInvoiceJourBiEntities
Key fields: InvoiceId, InvoiceDate, InvoiceAccount, InvoiceAmount, SalesType, dataAreaId
Use d365fo_query_entities tool to search for invoices
Example query to find free text invoices: d365fo_query_entities( entityName="CustInvoiceJourBiEntities", filter="InvoiceDate ge 2024-01-01", select=["InvoiceId", "InvoiceDate", "InvoiceAccount", "InvoiceAmount", "SalesType"] )
Args: invoice_id: The free text invoice number/ID (e.g., 'FTI-00000021', 'FTI-2024-001') legal_entity: The legal entity/company code (e.g., 'USMF', 'DEMF') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')
Returns: Dictionary with download result including saved file path
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | default | |
| save_path | No | ||
| invoice_id | Yes | ||
| legal_entity | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||