Dynamics GP–The Document is in use and could not be deleted, when attaching a document

When using document attach in Dynamics GP from Version 2016, it is not possible to attach a document if it is open in another application.

If a user has a document open and then attempts to attach it, the error is:

The document is in use and could not be attached.


I think this is a positive change, although it can require users to change working practices, just a little, to accommodate it.

I have the feeling this is to prevent data loss. If user attaching a document, such as word or excel, that is both open and has unsaved changes in it, then they mistakenly may believe they have safely stored the document in the document attachment. Unfortunately they may not realise the outstanding changes in the open document will not have been in the version they captured to GP, from the file system. Those changes could get lost quite easily (machine restarts or user saves to file system not refreshing the attached version).

Whilst protecting users from themselves, it does pose the problem that if a user has preview pane of file explorer open, or PDF viewer open looking at a PDF, then the filesystem will know the file is locked, and prevent them attaching the documents. For end users this can seem odd and frustrating behaviour, although obvious to a IT professional why this is so. With a little change to workflows and practices (user training), this can be overcome.

A common example seems to be AP departments scanning and attaching AP invoice PDFs. The document scanner opens the PDF automatically, in PDF viewer immediately after scanning, blocking its ability to be attached in GP. Users just need to learn to close documents and turn off previewers to work effectively again.