Document Distribution Routes
Document Distribution Routes enable documents to be transferred/copied between entities, while preserving their history through tags.
With document distribution routes, you can link entities to each other, ensuring that documents from one entity are automatically copied on to another (including template and extra fields).
When you copy a document for the first time, a new version (the copy) is created and enriched with additional tags associated with the entity where it originated. As you continue to copy this document to other entities, the same copy is retained, and new tags are added to reflect its links to the related documents. This ensures that the original document stays untouched.
For example: linking item to sales order
When you add an item to a sales order line, and that item has documents attached to it in Raptor, a copy of those documents are automatically added to the sales order (and to the item).
Setup in Business Central
1. 9A Raptor Document Distribution Setup
Set up the routes that specify from and to where documents will be copied.


From Entity: entity where you want to copy the documents from
To Entity: entity where you want to copy the documents to
Distribution Tags: this determines what documents you copy. Only documents with the document-tag that you specify here will be copied. It is important that you provide a distribution tag, otherwise the copying won't work.

These tags need to be created in Raptor (see Setup in Raptor: taxonomy > 1. File Tags)
Make sure to add these tags to your original document.
Action: Copy Selected Routes: you can copy the parameters (e.g. distribution tags) from this entity to another entity
2. List of possible distribution routes
Only combinations of routes that make sense will work. The following list shows all the 13 available routes you can use.
Customer
Sales Quote Header
Sales Order Header
Sales Invoice Header
Sales Return Order Header
Sales Credit Memo Header
Job
Vendor
Purchase Quote Header
Purchase Order Header
Purchase Invoice Header
Purchase Return Order Header
Purchase Credit Memo Header
Item
Sales/Purchase Quote Line
Sales/Purchase (Return) Order Line
Sales/Purchase Invoice Line
Sales/Purchase Credit Memo Line
Posted documents (posted invoice, posted shipment/receipt) will follow the route from the unposted. Once you set up the right routes for the unposted files. Configuring this route ensures that linked documents are also transferred to the posted documents.
3. Integration Scenarios
When you want to distribute documents from an item to a line-entity, you need to create a line tag in order for it to work. In this way the copied document is provided with a tag about the line.

The Line Tag needs to be created in Raptor (see Setup in Raptor: taxonomy > 2. Line Tags)
When you don't set up a line tag, the following error will appear when trying to fill in the line.

Setup in Raptor: taxonomy
1. Document type
In order for the distribution routes to work, you need to link Distribution Tags to the entities. These Distribution Tags need to be created in Raptor first.
Create the distribution tags under the root tag 'Document Type' in the taxonomy tree. In this example we created 'Drawing' and 'Contract', but you are free to create other tags and link them to certain entities.

2. Line Tags
Create Line Tags under your D365-BC root tag.

This is necessary for sales order lines and purchase order lines
Make sure to add a tag relation to the related order tag
Functionality
1. Document distribution: original and copies
When a document is added to an entity for the first time, a new document (the copy) is created with some additional tags. You can find this copy on both entities.
When you distribute the document to other entities after that, these tags are added to the same initial copy. This way, there is an original document and a single copy that shows all the tags indicating where the document has been distributed.
Entity where you copy FROM:
On the entity where you copy from (customer, vendor, item), you will have the original document and the copy when the document is used in another linked entity.
Original Document:

Copy:

The copy has the following tags to indicate that it is a copy of the original
CreatedBySystem
Extra information about the entity where it is copied to. In this example the document was copied to a sales order line
Sales order line - sales order - customer linked to that sales order
Entity where you copy TO:
On the entity where you copy to, you will only see the copy with all the
2. Original documents on 9A viewer
At first glance, it is not clear what document is the original document and what are the copies.
Because the copies of the document get the 'CreatedBySystem'-tag, you can filter the view to only show the original documents with the following query:

It is easier to save this query (step 3). For example under a name such as 'Original Documents'. That way, you can easily select the query and filter the documents
This filter is available for all 9A viewers, so you can use it on other entities as well

3. Example flow: item > sales order
Document distribution setup:
From item to sales order

Distribution tag = FileType\Drawing

1) Add a document to the item
On the item, add a document with the drawing distribution tag
2) Create a sales order with this item as a sales order line

When you send the sales order to raptor, two documents are made in this case:
1) The standard sales order document
2) A copy of the document from the item, with the following additional tags:
CreatedBySystem - sales order line - sales order - customer from the sales order

Last updated


