By Steve Endow
TOPIC: Microsoft Dynamics GP
I'm working with a customer to automate the import of Document Attachments into Dynamics GP.
As part of the testing process, we are having to clear out all of the test attachments that have been imported so that we can re-import them again.
In case it's of interest to anyone, here are some SQL scripts I created to delete out ALL document attachments for ALL payables transactions. You can modify the scripts to remove attachments for other record types.
Make sure to backup your company database before running any of these scripts.
If you find any mistakes or problems with these scripts, please let me know.
Steve Endow is a Microsoft MVP who works with Microsoft Dynamics 365 Business Central, Azure, .NET, SQL Server, and Power Platform
Dynamics 365 BC Resources List:
steveendow.link/bcresources
OR: bit.ly/bcresources
Showing posts with label Document Attach. Show all posts
Showing posts with label Document Attach. Show all posts
Wednesday, April 10, 2019
Thursday, January 24, 2019
Dynamics GP Document Attach Record Type (Origin Description) Codes
By Steve Endow
I have been working on a few Dynamics GP Document Attach projects lately, and I haven't been able to find a complete list of the record type codes used in the Doc Attach tables.
I have been working on a few Dynamics GP Document Attach projects lately, and I haven't been able to find a complete list of the record type codes used in the Doc Attach tables.
To find the codes, query the CO00101 table and look at the ODESCTN field values.
Here's the partial list that I've compiled so far for a US installation of Dynamics GP. As I test additional record types, I'll update this list.
If anyone knows of a complete list or has updates, let me know.
**NOTE: It appears that some of the Doc Attach record type codes may vary by region. For example, UK installations use "Creditor" instead of "Vendor". But "CC" is still used for UK Customers, rather than "Debtor".
CO00101 Table |
Here's the partial list that I've compiled so far for a US installation of Dynamics GP. As I test additional record types, I'll update this list.
If anyone knows of a complete list or has updates, let me know.
Customer: CC
Vendor: Vendor (Creditor in UK)
Item: IC
GL Transaction: GL
PM Transaction: PM
Purchase Order: PO
Purchase Requisition: REQ
PO Shipment: PS
PO Shipment/Invoice: PSI
Receivables Transaction: RM
SOP Order: SO
SOP Invoice: SI
Note: NOTES
**NOTE: It appears that some of the Doc Attach record type codes may vary by region. For example, UK installations use "Creditor" instead of "Vendor". But "CC" is still used for UK Customers, rather than "Debtor".
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.
Thursday, December 20, 2018
Bulk Export Dynamics GP Document Attachments using .NET
By Steve Endow
2/20/2023 UPDATE: Version 1.30 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.30: Precipio SaveDocAttachFiles v1.30.zip
Version 1.30 adds support for the EFOQUS SharePoint Connector for Business Central
2/20/2023 UPDATE: Version 1.30 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.30: Precipio SaveDocAttachFiles v1.30.zip
Version 1.30 adds support for the EFOQUS SharePoint Connector for Business Central
-Save files as <Attachment Name>!<BC Table Num>!<Record ID>
-Save files as <Attachment Name>!<BC Table Num>!<BC Record Type Num><Record ID>
New record types can be added by editing the SaveDocAttachFiles.exe.config file. Locate the RecordTypes setting at the bottom of the file and add new name + code pairs to the list.
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.
New record types can be added by editing the SaveDocAttachFiles.exe.config file. Locate the RecordTypes setting at the bottom of the file and add new name + code pairs to the list.
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.
Subscribe to:
Posts (Atom)
How many digits can a Business Central Amount field actually support?
by Steve Endow (If anyone has a technical explanation for the discrepancy between the Docs and the BC behavior, let me know!) On Sunday nig...
-
By Steve Endow In June 2021, I discussed my circuitous journey to learn about and understand the $metadata and $expand OData "query o...
-
By Steve Endow Last updated July 10, 2023 (272 resources) There is so much information being published about Dynamics 365 Business C...
-
By Steve Endow On January 23, 2021, I recorded a video showing how to create a simple text file using AL in Business Central. Here is the v...