Document Management

This document provides an overview on how to extend the most Important components of Document Management.

1. Extending document distribution as customization with custom entities

1.1. Extend enum EXADocuEntityType with the custom entities

Start by adding the entities you want to add as a type in an extension of the 'EXADocuEntityType' base enum. As an example, an entity called 'NewEntity' was added to the enum, make sure your naming makes sense for your entity (see the other standard examples).

1.2. Extend table EXADocuDistributionTable

Here we extend the 'EXADocuDistributionTable' table. This Is so we can map the D365 FO tables to the entity type we added in the previous section.

1.3. Implementation of the distribution

In this next step, we will add the actual distribution of the documents to the pieces of code where we want them to get distributed. Usually it will be a piece of code that you need to call when you insert new records, like with the creation of for example a purchase order line.

As an example, we'll have a look at how to copy documents from an item to your newly made purchase order line. You need to call the class 'EXADocuDistributionManager' with 2 parameters; your 'From' record (in this example the table 'InventTable'), and your 'To' record (in this example the table 'Purchline')

2. Code snippets

1. Get a tag based on a record

This method allows you to get the tag that's based on the given record.

2. Get all documents based on a query setup (tags + document template)

This code allows you to get all documents based on a query setup, filtering by tags and document template:

3. Get all physical documents from tags or documents

This code shows how to get a list of physical documents based on a list of tags (type EXARaptorTagModelDC).

If you already have a list of documents (type EXARaptorDocumentDC), you can instead immediately call the method like so:

4. Tag all documents with additional tags

This method will tag all of the documents that are tagged with the commonFrom record tag and add the commonTo record tag to it, for example adding the tag of a sales order to all documents that are already tagged by a purchase order.

5. Archive a document

This method will allow you to archive a document, which means uploading it to the document warehouse, resolving the tags and attaching the tags and template (if applicable) to the uploaded document. If successful, it will return true, if not false.

Another method you can use to archive is the following:

This method will return the document (type EXARaptorDocumentDC) instead of true/false, regardless of whether the tagging with tags or template succeeded. Warnings will of course still be thrown to show that the tagging failed.

6. Full process of making a tag, retrieving all documents and tagging them with the new tag

Last updated