Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Microsoft Dynamics 365 Business Central

You're reading from   Mastering Microsoft Dynamics 365 Business Central Discover extension development best practices, build advanced ERP integrations, and use DevOps tools

Arrow left icon
Product type Paperback
Published in Dec 2019
Publisher Packt
ISBN-13 9781789951257
Length 770 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Duilio Tacconi Duilio Tacconi
Author Profile Icon Duilio Tacconi
Duilio Tacconi
Stefano Demiliani Stefano Demiliani
Author Profile Icon Stefano Demiliani
Stefano Demiliani
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Section 1: Dynamics 365 Business Central - Platform Overview and the Basics of Modern Development FREE CHAPTER
2. Microsoft Dynamics 365 Business Central Overview 3. Mastering a Modern Development Environment 4. Online and Container-Based Sandboxes 5. Section 2: Developing Extensions for Dynamics 365 Business Central
6. Extension Development Fundamentals 7. Developing a Customized Solution for Dynamics 365 Business Central 8. Advanced AL Development 9. Report Development with AL 10. Section 3: Debugging, Testing, and Release Management (DevOps)
11. Installing and Upgrading Extensions 12. Debugging 13. Automated Test Development with AL 14. Source Control Management and DevOps with Business Central 15. Section 4: Advanced Integrations with Dynamics 365 Business Central
16. Dynamics 365 Business Central APIs 17. Serverless Business Processes with Business Central and Azure 18. Monitoring, Scaling, and CI/CD with Azure Functions 19. Business Central and Integration with the Power Platform 20. Section 5: Moving Solutions to the New Extension Model
21. Integrating Machine Learning into Dynamics 365 Business Central 22. Moving Existing ISV Solutions to the New Extension Model 23. Useful and Proficient Tools for AL Developers 24. Other Books You May Enjoy

Handling attachments

Attachments are files that you can link to entities or documents in Dynamics 365 Business Central. Two main tables are used to store attachments:

  • Document attachment (ID = 1173)
  • Attachment (ID = 5062)

To store an attachment in these tables and then download an attachment from these tables, you need to use the previously mentioned UploadIntoStream and DownloadFromStream methods and load the BLOB field by using Streams.

An example of a function that uploads a file to the Attachment table is as follows:

procedure UploadAttachment()
var
Attachment: Record Attachment;
outStr: OutStream;
inStr: InStream;
tempfilename: text;
FileMgt: Codeunit "File Management";
DialogTitle: Label 'Please select a File...';
begin
if UploadIntoStream(DialogTitle, '', 'All Files (*.*)|*.*&apos...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image