With Microsoft’s latest license enforcement changes, storage costs in Dynamics 365 Finance & Operations (D365FO) are becoming increasingly relevant. Every gigabyte counts, and if you don’t actively monitor storage, it can silently inflate your bill.
Luckily, D365FO comes with several standard cleanup jobs to keep things in check, for example, clearing the batch job history or data management job logs.
Why a Print archive cleanup job?
Saving a report to the Print archive is one of the options of Docentric AX’s print destinations. It’s a handy feature because it creates a retrievable copy of the report that you can view or download later.
But here’s the catch: over time, the Print archive can grow significantly, and that growth translates directly into higher storage consumption in your tenant.
Unlike transactional data, old reports rarely need to be retained indefinitely. Configuring a scheduled Print archive cleanup job ensures only relevant and recent reports remain, reducing your storage footprint and lowering costs.
SharePoint as an alternative
If you need to keep reports for the long term, consider printing them to SharePoint instead of the D365FO Print archive.
SharePoint offers:
- More flexible document management.
- Better search capabilities.
- Lower storage costs.
This way, you can store important reports safely in SharePoint for long-term access while also keeping the Print archive light.
Configure DocuType
To enable SharePoint as a location, go to Organization administration > Document management > Document types and create a new type:
- Location: select SharePoint.
- SharePoint Address: click the edit button and select the site and folder where you want to store the documents.
-
Document removal options: here we have two fields that enable an interesting behavior for what we wish to achieve.
- Remove: choose between Document and physical type that deletes the file from SharePoint and the document in D365FO, or Document only, which only removes the reference to SharePoint in D365FO.
- Ask for confirmation: enable it to ask the user for confirmation of the deletion.
Thanks to the Remove option, we can clean the Print archive records while keeping the printed documents on SharePoint.
And now, how do you actually see what’s consuming storage? That’s where PPAC comes in.
Check your storage in PPAC
You can check your top consuming tables in the Power Platform admin center (PPAC):
Go to the Licensing menu, click Capacity add-ons, and then select the Finance and operations tab.
Here you have two columns:
- Finance and operations database usage: it shows the D365FO DB size. If you click it, a side pane will open, displaying a list of the tables ordered by size.
- Finance and operations file usage: it shows the overall file storage consumption. There are no details even if you click it.
The database usage pane displays the table list and lets you export a CSV file with the contents:
It’s important to keep an eye on this periodically to avoid surprises!
Running the Print archive cleanup job
To see the menu item and open the dialog, you must either have the System administrator role or be assigned the Maintain Print archive for all users duty (DocPrintArchiveAllMaintain).
To run the Print archive cleanup job, go to Organization administration > Inquiries and reports > Print archive. You will see the Print archive cleanup button in the action pane.
How it works
The functionality features a pre-built query filter, where if you add any filter to the form’s grid columns, they will be applied to the Print archive cleanup job query. For example, if we filter on account number 104:
The Account number field in the query is automatically populated. If you don’t add any filters, you can build the query manually or leave it empty and clear all records.
Once the process finishes, a message appears showing how many records were deleted.
You can run the process:
- Synchronously: if you’re deleting only some records.
- In batch: if you want to schedule it regularly or handle large datasets.
Customize using a delegate
Developers can use the DocPrintArchiveCleanupService.processDeletingRecord delegate to take action before records and their archived report documents are deleted.
By subscribing to this delegate, you can log details about the deleted items or even move the report documents to another storage location instead of permanently removing them.
Conclusion
Managing storage in D365FO isn’t just about performance; it's about controlling costs.
While standard cleanup jobs handle logs and histories, the Print archive is an often-neglected storage hog.
By setting up a Print archive cleanup job and using SharePoint for long-term report storage, you can:
- Reduce database usage.
- Lower licensing costs.
- Keep your environment efficient.