> For the complete documentation index, see [llms.txt](https://docs.dynalogic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dynalogic.com/birds-document-warehouse-product-overview/d365-finance-and-operations/document-management.md).

# Document Management

## Relation setup <a href="#relation-setup" id="relation-setup"></a>

The relation setup give the end-users possibility to see the documents of a specific entity/tag from a form where the selected record is not used as entity/tag. This can be achieved with relation setup. This form can be found via 9A Raptor DWH > Setup > Document management > Relation setup.

The **Relation Setup** feature allows end-users to view documents associated with a specific tag, even when the selected record is not directly used as a tag. This capability is enabled through relation configurations.

To access the Relation Setup:\
Navigate to **9A Raptor DWH > Setup > Document Management > Relation Setup**.

**Example Scenario**

Suppose you want to view all documents related to an imported invoice from a ledger journal. Although ledger journals are not used as tags, there is a relationship between the imported invoice and the ledger journals. To achieve this, you can define a relation between the `DocNo` field in the `EXAPurchInvoiceImported` table and the `EXADocNo` field in the `LedgerJournalTable`.

**Supported Relation Types**

We support two types of relations:

1. **Direct Relation**\
   A direct link exists between the selected record and the associated entity. In this case, the DocNo field.

   * **Example:**\
     Entity: `EXAPurchInvoiceImportedEntity`\
     Field: `DocNo`\
     Table: `LedgerJournalTable`\
     Field: `EXADocNo`

   <figure><img src="https://1567270722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbMdBZV3cNP56k0aYYCI6%2Fuploads%2Fgit-blob-280cba860a5554266b403075d5b0534ed98d81ce%2Fimage%20(127).png?alt=media" alt=""><figcaption></figcaption></figure>

   Result: when opening Raptor on the ledger journal, the Document Warehouse will open filtered on the associated 'EXAPurchInvoiceImported' tag, instead of the ledger journal entry itself.
2. **Indirect Relation**\
   An indirect link exists between the selected record and the associated entity. Indirect relations require a **direct relation** as a base (finish-relation). Therefore, you must configure direct relations before creating indirect ones.

   Additionally, indirect relations can connect tables through different fields or table names.

   * **Example:**

   Entity: `EXAPurchInvoiceImportedEntity`\
   Field: `DocNo`\
   Table: `LedgerJournalTrans`\
   Field: `JournalNum` (via the direct relation mentioned above).

<figure><img src="https://1567270722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbMdBZV3cNP56k0aYYCI6%2Fuploads%2Fgit-blob-230edf8a9e42e4f426054ae1c63db02dbb4c6891%2Fimage%20(128).png?alt=media" alt=""><figcaption></figcaption></figure>

Result: when opening Raptor on the ledger journal lines, the Document Warehouse will open filtered on the associated 'EXAPurchInvoiceImported' tag, instead of the selected line itself. This is accomplished by linking the line level to the imported invoice through the ledger journal header, an indirect link.

These are a few handy relations to set up for entity EXAPurchInvoiceImported. These will make invoices from the All Invoices screen in Raptor Input Management available in multiple places:

<table data-header-hidden data-full-width="false"><thead><tr><th valign="bottom"></th><th width="99" valign="bottom"></th><th width="216" valign="bottom"></th><th width="235" valign="bottom"></th><th valign="bottom"></th><th width="198" valign="bottom"></th></tr></thead><tbody><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">AccountingDistribution</td><td valign="bottom">SourceDocumentHeader</td><td valign="bottom">VendInvoiceInfoTable</td><td valign="bottom">SourceDocumentHeader</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">LedgerJournalTrans</td><td valign="bottom">journalnum</td><td valign="bottom">LedgerJournalTable</td><td valign="bottom">journalnum</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">LedgerJournalTrans</td><td valign="bottom">vendtransid</td><td valign="bottom">vendtrans</td><td valign="bottom">recid</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">ProjCostTrans</td><td valign="bottom">VoucherJournal</td><td valign="bottom">Vendtrans</td><td valign="bottom">Voucher</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">ProjPostTransView</td><td valign="bottom">TransId</td><td valign="bottom">ProjCostTrans</td><td valign="bottom">TransId</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">SpecTrans</td><td valign="bottom">RefRecId</td><td valign="bottom">VendTransOpen</td><td valign="bottom">RecId</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">VendInvoiceInfoLine</td><td valign="bottom">parmid</td><td valign="bottom">vendinvoiceinfotable</td><td valign="bottom">parmid</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">vendpackingsliptrans</td><td valign="bottom">inventtransid</td><td valign="bottom">VendInvoiceInfoLine</td><td valign="bottom">inventtransid</td></tr><tr><td valign="bottom">Indirect</td><td valign="bottom"></td><td valign="bottom">VendTransOpen</td><td valign="bottom">RefRecId</td><td valign="bottom">Vendtrans</td><td valign="bottom">RecId</td></tr><tr><td valign="bottom">Direct</td><td valign="bottom">DocNo</td><td valign="bottom">LedgerJournalTable</td><td valign="bottom">EXADocNo</td><td valign="bottom"></td><td valign="bottom"></td></tr><tr><td valign="bottom">Direct</td><td valign="bottom">DocNo</td><td valign="bottom">VendInvoiceInfoTable</td><td valign="bottom">EXADocNo</td><td valign="bottom"></td><td valign="bottom"></td></tr><tr><td valign="bottom">Direct</td><td valign="bottom">DocNo</td><td valign="bottom">VendInvoiceJour</td><td valign="bottom">EXADocNo</td><td valign="bottom"></td><td valign="bottom"></td></tr><tr><td valign="bottom">Direct</td><td valign="bottom">DocNo</td><td valign="bottom">VendTrans</td><td valign="bottom">EXADocNo</td><td valign="bottom"></td><td valign="bottom"></td></tr></tbody></table>

## Distribution setup <a href="#distribution-setup" id="distribution-setup"></a>

The distribution setup give the end-users possibility to distribute documents from an entity to an entity based upon conditions. We provide two different solutions to distribute documents. It can be done with tagging context of entity to (same document with tags from both entities) or to copy documents and tagging context of entity to (= standalone documents). This form can be found via 9A Raptor DWH > Setup > Document management > Distribution setup.

| Setting                           | Purpose                                                                           |
| --------------------------------- | --------------------------------------------------------------------------------- |
| Tags                              | Retrieve documents based upon predefined tags.                                    |
| Description                       | Free text for extra explanation.                                                  |
| Entity type from                  | The entity from which documents should be distributed.                            |
| Entity type to                    | The entity to which documents should be distributed.                              |
| Distribution type: Add tag        | Use the same documents, tagging them with the context of the target entity.       |
| Distribution type: Copy documents | Create standalone documents, tagging them with the context of the target entity.  |
| Copy tags                         | For Copy documents, also apply the tags from the first column.                    |
| Copy document template            | For Copy documents, also copy the original document template to the new document. |

Our 9A Raptor DWH provides a hybrid solution where you can upload documents to the standard D365FO document handling framework with a reference to 9A Raptor DWH. You need to create a document type with Attach file as class. For a location please select Document Warehouse as external storage.

With this functionality a reference is made between the document handling record and 9A Raptor DWH. You can open or remove the reference like other document handling records.

This chapter describes the necessary setup for a proper security integration with 9A Document Management. There is a security privilege that can be added to a custom duty/role for displaying the 9A Document Management dino icon.

Also the next duties can be added for the user that is used in the 9A Raptor DWH synchronisation. This user is linked with the Azure Client Id via the Azure Active Directory applications in Dynamics 365 for Financials and Operations.

You can validate a data management export project against 9A Raptor DWH to identify missing entity configurations. Open the **Document Warehouse** menu for the export project.

Every missing data entity In 9A Raptor DWH will be displayed In the Infolog. Via this way any system administration can add missing data entities In 9A Raptor DWH and complete the Integration.

**Distribution Setup Overview**

The **Distribution Setup** feature allows end-users to distribute documents between entities based on specific conditions. The 'distribution' means either adding new tags to the source document or making a copy of the document and adding new tags.

You can access the Distribution Setup form via:\
**9A Raptor DWH > Setup > Document Management > Distribution Setup**

Before setting up distribution rules, make sure Distribution is enabled, see [9A Raptor DWH Parameters](https://docs.dynalogic.com/birds-document-warehouse-product-overview/d365-finance-and-operations/parameters.md#document-management-distribution-setup).

***

**Key Terms and Options**

| Option                                | Meaning                                                                                                                                                                                                                        |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Tags**                              | Used to retrieve documents based on predefined identifiers.                                                                                                                                                                    |
| **Description**                       | Free-text field to describe your distribution.                                                                                                                                                                                 |
| **Entity Type From**                  | The source entity for the distribution.                                                                                                                                                                                        |
| **Entity Type To**                    | The target entity for the distribution.                                                                                                                                                                                        |
| **Distribution Type: Add Tag**        | The same document is tagged with the context of the target entity.                                                                                                                                                             |
| **Distribution Type: Copy Documents** | A new, standalone document is created and tagged with the context of the target entity.                                                                                                                                        |
| **Copy Tags**                         | For "Copy Documents" distributions, the tags from the source document are applied to the new document.                                                                                                                         |
| **Copy Document Template**            | The document template (see Raptor templates: [Templates](https://docs.dynalogic.com/birds-document-warehouse-product-overview/setup-and-configuration/templates.md)) from the original document is copied to the new document. |
| **Tags to Attach**                    | The tags that should be added during the distribution.                                                                                                                                                                         |
| **Document template**                 | The template that should be assigned during the distribution.                                                                                                                                                                  |

**Example scenario**

<figure><img src="https://1567270722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbMdBZV3cNP56k0aYYCI6%2Fuploads%2Fgit-blob-d6bd969a340c4da3cd88150f097e3e153ad1de38%2Fimage%20(109).png?alt=media" alt=""><figcaption></figcaption></figure>

In the example above, distribution setup is used to distribute documents tagged as 'Drawing' from the Released product to the Production order and Purchase order line.\
The distribution of product related documents to the purchase order level also makes them eligible as attachments for the purchase order emails, see [Output Management](https://docs.dynalogic.com/birds-document-warehouse-product-overview/d365-finance-and-operations/output-management.md#report-setup-attachments).

**Applying Distribution Rules**

You can define specific distribution rules for certain records based on the source entity. To do this, use the **Edit Query** menu item to create relationships between the source entity and other tables.

Examples:

* Distribute documents with specific tags for **released products** in a particular **item group**.
* Distribute documents for **released products** associated with a specific **primary vendor**.

**Available Distribution routes**

| Source entity              | Target entities                                                                                                                                                                          |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Product                    | Released product                                                                                                                                                                         |
| Released product           | Sales order line; purchase order line; sales quotation line; sales agreement line; purchase agreement line; production order; purchase requisition line; request for quotation case line |
| Sales order header         | Sales invoice journal; sales confirmation journal; sales packing slip journal; load header; shipment header                                                                              |
| Purchase order header      | Purchase order confirmation journal; load header; shipment header                                                                                                                        |
| Sales order line           | Production order; load line                                                                                                                                                              |
| Sales quotation line       | Sales order line                                                                                                                                                                         |
| Sales agreement line       | Sales order line                                                                                                                                                                         |
| Purchase agreement line    | Purchase order line                                                                                                                                                                      |
| Sales quotation            | Customer quotation journal                                                                                                                                                               |
| Customer free text invoice | Customer invoice journal                                                                                                                                                                 |
| Purchase requisition line  | Purchase order line; request for quotation case line                                                                                                                                     |
| Customer account           | Sales order header                                                                                                                                                                       |
| Customer invoice account   | Sales order header                                                                                                                                                                       |
| Vendor account             | Purchase order header                                                                                                                                                                    |
| Vendor invoice account     | Purchase order header                                                                                                                                                                    |
| Project invoice proposal   | Project invoice journal                                                                                                                                                                  |
| Sales agreement header     | Sales agreement confirmation header                                                                                                                                                      |
| Purchase agreement header  | Purchase agreement confirmation header                                                                                                                                                   |

### **Distribution Entity Type Setup** <a href="#distribution-setup-distribution-entity-type-setup" id="distribution-setup-distribution-entity-type-setup"></a>

With the **Distribution Entity Type Setup** you can set when the distribution of the documents should take place. For each target entity type (**Entity Type To**) a **Processing mode** can be selected.

You can access the Distribution Entity Type Setup form via:\
**9A Raptor DWH > Setup > Document Management > Distribution Entity Type Setup**

<div align="left"><figure><img src="https://1567270722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbMdBZV3cNP56k0aYYCI6%2Fuploads%2Fgit-blob-ba27c9420d9801e5496bf8f148d2bb0301785013%2Fimage%20(720).png?alt=media" alt="" width="352"><figcaption></figcaption></figure></div>

The processing mode options are:

| Processing mode                  | Behavior                                                                                                                    |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Immediately (During posting)** | Distribute the documents at the same time as the target entity is created.                                                  |
| **In batch (After posting)**     | Distribute the documents later, after the target entity is created. A batch job must be set up to process the distribution. |

The default option for most entities is **Immediately (During posting)**. It can be set to **In batch (After posting)** if

* a lot of documents are to be distributed and the performance is impacted
* the distributed documents are not needed immediately after posting
* there is a chance of a transaction rollback after the document distribution.

{% hint style="warning" %}
Once a document is distributed, a transaction rollback will not perform the rollback of the distribution.
{% endhint %}

For some entities the option **In batch (After posting)** is the default or even mandatory. It can be mandatory when there is a many-to-one/many relation between the source and the target entity.

When a target entity is created that has its **Processing mode** set to **In batch (After posting)**, a queue record will be created to process the document distribution later on.

Use the **Distribute queued documents** periodic task to schedule the processing of those queued document distributions.

You can access the Distribution Entity Type Setup form via:\
**9A Raptor DWH > Periodic tasks > Document Management > Distribute queued documents**

## Standard document management <a href="#standard-document-management" id="standard-document-management"></a>

Raptor is able to integrate seemlessly with the standard document handling framework of D365F\&O. This hybrid solution allows you to upload documents to the D365 document handling engine while storing the actual file in Raptor, ensuring that documents are visible in both places without any information being duplicated.

To set this up, create a document type with the class set to *Attach file*. For the location, choose *9A Raptor Document Warehouse* as the external storage option.

<figure><img src="https://1567270722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbMdBZV3cNP56k0aYYCI6%2Fuploads%2Fgit-blob-0b67f5c54e3344843aa0f985473c7eea42faee31%2Fimage%20(108).png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.dynalogic.com/birds-document-warehouse-product-overview/d365-finance-and-operations/document-management.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
