d365fo_download_srs_report
Download business documents like invoices and purchase orders from Dynamics 365 Finance & Operations as PDF files by generating SSRS reports.
Instructions
Download SQL Server Reporting Services (SSRS/SRS) reports from D365 Finance & Operations as PDF files.
This tool generates and downloads business documents like invoices, purchase orders, confirmations, and other reports by calling the D365FO SRS reporting engine. The report is returned as a PDF file saved to a specified location.
Args: document_id: The unique identifier/key of the document (e.g., 'CIV-000708', 'SO-001234') legal_entity: The legal entity/company code (DataAreaId) where the document exists (e.g., 'USMF') controller_name: The SSRS controller class name (default: 'SalesInvoiceController') Common controllers: - SalesInvoiceController: Customer invoices - FreeTextInvoiceController: Free text invoices - CustDebitCreditNoteController: Debit/credit notes - SalesConfirmController: Sales confirmations - PurchPurchaseOrderController: Purchase orders data_table: The database table containing the document (default: 'CustInvoiceJour') data_field: The field name that stores the document ID (default: 'InvoiceId') document_type: Human-readable document type for filename (default: 'SalesInvoice') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')
Common controller/table/field combinations:
| Controller | Table | Field Name | Field Type | Document Type |
|-----------|-------|-----------|------------|---------------|
| SalesInvoiceController | CustInvoiceJour | InvoiceId | Invoice ID | Sales Invoice |
| FreeTextInvoiceController | CustInvoiceJour | InvoiceId | Invoice ID | Free Text Invoice |
| CustDebitCreditNoteController | CustInvoiceJour | InvoiceId | Invoice ID | Debit/Credit Note |
| SalesConfirmController | CustConfirmJour | ConfirmId or SalesId | Confirm/Sales ID | Sales Confirmation |
| PurchPurchaseOrderController | VendPurchOrderJour | PurchId | Purchase Order ID | Purchase Order |
Returns:
Dictionary with download result including saved file path
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | ||
| legal_entity | Yes | ||
| controller_name | No | SalesInvoiceController | |
| data_table | No | CustInvoiceJour | |
| data_field | No | InvoiceId | |
| document_type | No | SalesInvoice | |
| save_path | No | ||
| profile | No | default |