Thursday, December 20, 2018

Bulk Export Dynamics GP Document Attachments using .NET

By Steve Endow

1/23/2019 UPDATE:  Version 1.20 released


A user on the GPUG Open Forum asked if there was a way to export all of the documents that are attached to Dynamics GP customers.

I previously wrote a blog posts showing how to export a single document attachment using BCP:

https://dynamicsgpland.blogspot.com/2017/05/extract-dynamics-gp-document-attach.html


And another showing how to export a single document attachment using .NET:

https://dynamicsgpland.blogspot.com/2017/05/extract-and-save-dynamics-gp-document.html


But the BCP solution is only for a single attachment, and the .NET solution didn't have any features for filtering or organized export of attachments.

So today I updated the .NET solution to allow the user to select a Database, Record Type, and indicate whether Deleted attachments should be exported.



Once those options are selected, the user can retrieve a list of all of the attachments, which shows the type, the associated record number, the file name, and file size.

The user can then select an export path and click a button to export all of the attachments to disk.


The application and full source code can be downloaded here:

       Version 1.20:  https://1drv.ms/u/s!Au567Fd0af9TpRUtDRq_heyOh50p


Version 1.20 includes several enhancements:

-Login dialog allows you to specify SQL Server, username, and password for SQL login
-Support named system databases
-Config file allows you to add additional document types
-Added PM and POP document types


New record types can be added by editing the configuration file.


Please note that this .NET application was assembled in a few hours, and is not a refined, polished, commercial software release.  It does not have lots of configuration options or error handling, so you will want to test it in a TEST environment and be aware that it may need some modifications to work in your environment.


Steve Endow is a Microsoft MVP in Los Angeles.  He is the owner of Precipio Services, which provides Dynamics GP integrations, customizations, and automation solutions.

You can also find him on Twitter and YouTube





No comments:

Post a Comment

All comments must be reviewed and approved before being published. Your comment will not appear immediately.

"I don't want to bother turning on Two Factor Authentication"

By Steve Endow January 2019 Update:  A security researcher has developed a tool that can intercept logins and 2FA codes through a man-in-...