d365fo_download_customer_invoice
Download customer invoice PDFs from Dynamics 365 Finance & Operations using invoice ID and legal entity parameters. This tool simplifies invoice retrieval with preset configurations for quick access.
Instructions
Download a customer invoice report as PDF from D365 Finance & Operations.
This is a convenience tool with preset configurations for customer invoices. Use this when you need to quickly download customer invoices without specifying all the technical parameters.
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 invoices: d365fo_query_entities( entityName="CustInvoiceJourBiEntities", filter="InvoiceDate ge 2024-01-01", select=["InvoiceId", "InvoiceDate", "InvoiceAccount", "InvoiceAmount", "SalesType"] )
Args: invoice_id: The customer invoice number/ID (e.g., 'CIV-000708', 'INV-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 |
|---|---|---|---|
| invoice_id | Yes | ||
| legal_entity | Yes | ||
| save_path | No | ||
| profile | No | default |