Document Attachment
Document Attachment helps you manage important documents for your business entities. Store, track, and monitor documents with expiry dates such as passports, licenses, certificates, and compliance documents. The system automatically tracks expiry dates and can send notifications before documents expire.
What you can do with Document Attachment
You can use Document Attachment to:
- Store documents for Customers, Vendors, Addresses, Customer Items, and Shipping Agents
- Track document expiry dates and receive notifications before expiration
- Verify documents and maintain verification history
- Manage document status with customizable workflows
- Set retention periods for compliance requirements
- Organize documents by type with predefined categories
- View and download attached files directly from Business Central
How Document Attachment works
The Document Attachment module manages the complete lifecycle of business documents from upload to expiration:
Core components
- Document Attachment - The main record that stores document information including dates, verification status, and file attachments
- Document Attachment Type - Predefined document categories (e.g., Passport, License, Certificate) with default settings
- Status Management - Optional status workflows to control document lifecycle
- Expiry Tracking - Automatic monitoring of expiration dates with configurable notifications
Document lifecycle
- Upload - Attach files to document records for specific business entities
- Track - Monitor issue dates, expiry dates, and retention periods
- Verify - Mark documents as verified with automatic tracking of who verified and when
- Notify - Receive automatic notifications before documents expire
- Archive - Change document status to Archived when no longer needed
Get started
Set up document attachment types
Before creating document attachments, set up the types of documents you want to track:
- Choose the
icon, enter Document Attachment Types, and then choose the related link. - Choose New to create a document type.
- Fill in the following fields:
- Code - A unique identifier for the document type (e.g., PASSPORT, LICENSE)
- Description - A clear description of the document type
- Requires Expiry Date - Select this if documents of this type must have an expiry date
- Default Retention Period - Specify how long to retain documents (e.g., 7Y for 7 years)
- Notify Days Before Expiry - Specify when to send expiry notifications (e.g., 30D for 30 days before expiry)
- Default Issue Place - Enter a default location where documents are typically issued
Create a document attachment
You can create document attachments from various entity pages:
- Open the entity (Customer, Vendor, Address, Customer Item, or Shipping Agent).
- Choose Related, then choose Document Attachments.
- Choose New to create a new document attachment.
- Fill in the document information:
- Document Attachment Type - Select the type of document
- Document No. - Enter the official document number
- Description - Add a description or additional details
- Issue Date - Enter when the document was issued
- Expiry Date - Enter when the document expires (required for some document types)
- Issue Place - Specify where the document was issued
- Issuing Authority - Enter the organization that issued the document
- Choose Upload Document to attach a file.
Upload multiple files
When you need to attach multiple documents at once:
- From the Document Attachments page, choose Upload Multiple Files.
- Select multiple files from your computer.
- The system creates a separate document attachment record for each file.
- Edit each record to add document details such as document number, expiry date, and description.
Verify documents
To verify the authenticity of a document:
- Open the document attachment record.
- Select the Verified field.
- The system automatically records:
- Verified By - Your user ID
- Verified Date - Today's date
To remove verification, clear the Verified field. The system removes the verification information.
View and download documents
To view or download an attached document:
- Choose View Document to open PDF files directly in your browser
- Choose Download Document to download the file to your computer
Track document status
Documents have four automatic statuses:
- Active - The document is currently valid and in use
- Expired - The document has passed its expiry date
- Pending Renewal - The document needs to be renewed
- Archived - The document is no longer in active use
You can also configure custom status workflows using Status Templates for more complex document lifecycle management.
Monitor expiring documents
The system helps you stay ahead of document expiration:
Expiry notifications
When you configure the Notify Before Expiry field on a document attachment or document type:
- The system calculates the notification date based on the expiry date
- Notifications are sent before the document expires
- You can configure automated emails or function sets to handle notifications
Document status updates
You can automate status changes for expired documents:
- Configure a scheduled task to check for expired documents
- The system automatically changes the status from Active to Expired
- Optionally update the status of the related entity (e.g., block a vendor when their certificate expires)
Automate document management
You can automate document management tasks by configuring function sets with the Document Attachment Functions codeunit (3PL Document Attach. Functions). These functions can be scheduled using Job Queues or triggered by status changes and other business events.
Available automated functions
The system provides four automated functions for document management:
| Function Code | Function Name | Purpose |
|---|---|---|
| CHECKEXPIREDDOCS | Check and update expired document attachments | Automatically identify expired documents and update their status |
| NOTIFYEXPIRINGDOCS | Notify for expiring document attachments | Send notifications for documents approaching expiry |
| APPLYDEFLTRETENTION | Delete document attachments past retention period | Remove documents that have exceeded their retention period |
| CHECKENTITYWOACDOCS | Check entity without active document attachments | Identify entities missing required active documents |
Set up automated expiry checking
To automatically check for and update expired documents:
- Choose the
icon, enter Function Sets, and then choose the related link. - Create a new function set and add the following:
- Codeunit: 3PL Document Attach. Functions
- Function Code: CHECKEXPIREDDOCS
- Configure the parameters:
- TABLEFILTER - Optional filter to limit which documents to check (e.g., specific entity types or document types)
- NEW STATUS - Status code to apply to expired documents
- REASON CODE - Reason code for the status change
- REASON DESC - Description explaining why the status changed
- ENTITY STATUS - Optional status to apply to the related entity (e.g., Customer, Vendor)
- ENTITY REASON CODE - Reason code for entity status change
- ENTITY REASON DESC - Description for entity status change
- Schedule the function set with a Job Queue Entry to run daily.
Example configuration
To automatically mark expired passport documents as expired and notify the responsible party:
- Function Code: CHECKEXPIREDDOCS
- TABLEFILTER:
Document Attachment Type Code=PASSPORT - NEW STATUS: EXPIRED
- REASON CODE: AUTO
- REASON DESC: Automatically expired based on expiry date
Set up expiry notifications
To send notifications before documents expire:
- Create a function set with:
- Function Code: NOTIFYEXPIRINGDOCS
- Configure the parameters:
- TABLEFILTER - Optional filter to limit which documents to check
- NEW STATUS - Status code to apply after notification (e.g., Pending Renewal)
- REASON CODE - Reason code for status change
- REASON DESC - Description for status change
- ENTITY STATUS - Optional status for the related entity
- ENTITY REASON CODE - Entity reason code
- ENTITY REASON DESC - Entity reason description
- FUNCTION SET - Function set ID to execute for each expiring document (for sending emails or other notifications)
- Schedule with a Job Queue Entry to run weekly or daily.
Tip
Create a separate function set for email notifications and reference its ID in the FUNCTION SET parameter. This allows you to customize notification messages and recipients.
Set up retention period management
To automatically delete documents past their retention period:
- Create a function set with:
- Function Code: APPLYDEFLTRETENTION
- Configure the parameters:
- TABLEFILTER - Optional filter to limit which documents to process
- DELETE EXPIRED - Set to
trueto delete documents, orfalseto only report
- Schedule with a Job Queue Entry to run monthly.
Warning
Documents deleted by this function are permanently removed. Ensure retention periods are configured correctly before enabling automatic deletion.
Set up entity compliance checking
To identify entities without required active documents:
- Create a function set with:
- Function Code: CHECKENTITYWOACDOCS
- Configure the parameters:
- TABLEFILTER - Filter for required document types (e.g.,
Document Attachment Type Code=PASSPORT|LICENSE) - ERRORMSG - Optional error message to display if active documents are missing
- NEW STATUS - Status to apply to entities without active documents
- REASON CODE - Reason code for status change
- REASON DESC - Description for status change
- TABLEFILTER - Filter for required document types (e.g.,
- Use this function in status changes or validation processes to ensure entities have required documentation before transactions.
Schedule automated tasks with Job Queue
To schedule automated document management:
- Choose the
icon, enter Job Queue Entries, and then choose the related link. - Create a new Job Queue Entry:
- Object Type to Run: Codeunit
- Object ID to Run: Your Function Set codeunit
- Parameter String: Reference to your configured function set
- Set the recurrence pattern:
- Daily - For expiry checking and notifications
- Weekly - For reminder notifications
- Monthly - For retention period management
- Set the Next Run Date/Time and enable the job queue entry.
Work with document attachments
Search for documents
You can quickly find documents using:
- Document No. - Search by official document number
- Reference No. - Search by internal or external reference
- Entity No. - Find all documents for a specific entity
- Document Attachment Type - Filter by document type
Manage document retention
For compliance requirements, you can set retention periods:
- Open the document attachment record.
- In the Retention Period field, specify how long to keep the document (e.g., 7Y for 7 years).
- The retention period helps you determine when documents can be safely deleted.
Delete document attachments
To delete a document attachment:
- Open the document attachment record.
- Choose Delete Document to remove only the attached file, or
- Delete the entire record to remove both the document information and the file
Note
The system checks status permissions before allowing deletion. Some statuses may be configured to block deletion.
Advanced features
Status management integration
Document attachments integrate with the status management framework:
- Configure a Status Template for document lifecycle management
- Use status functions to control when documents can be edited or deleted
- View status history with the Status Log action
- Move between statuses using Previous Status and Next Status actions
Integration with business processes
Document attachments work with your business processes:
- Function Sets - Run automated actions when document status changes using the Document Attachment Functions codeunit
- Job Queues - Schedule automated document checks, notifications, and retention management
- Compliance Checks - Validate that required documents exist and are current before posting transactions
- Status Functions - Trigger document validation and entity status updates based on document lifecycle events
Document attachment analysis
To analyze your document portfolio:
- Choose the
icon, enter Document Attachment Analysis, and then choose the related link. - View documents grouped by:
- Entity Type
- Document Type
- Status
- Expiry Date range
- Identify documents that need attention such as:
- Documents expiring soon
- Unverified documents
- Documents without files attached