Posts

Showing posts from 2018

Create and add to a blob storage in MSDyn365FO

Image
This post shows how you can create a Azure blob storage and add files using your Azure storage account from D365FO. I have created a job that finds an attachment on a sales order and uploads it to the Azure blob storage just to show how a simple scenario could work. To begin with, you will need to create your storage account. You can have a look at this article on how to create a blob storage account: Create a storage account Once you have created a storage account you will need the connection string. See below: Next thing is the job. I’ve pasted screenshots below: Once you run the above job and file upload is successful. You’ll find a container named ‘mycontainer’ inside your Azure blob storage and a document that you would have attached on the Sales order record.

Printing PDF Attachments in MSDyn365FO

Image
In this post I’ll detail how you can print PDF document attachments using AXs DocumentContract framework. I have used this forum post as a reference: https://community.dynamics.com/ax/f/33/p/222925/785091#785091 1. Create extension of the DocuView form to introduce a new Print button. 2. Next thing is to create a handler class that will have all our event handlers. a. Firstly, we create a class with the reference to DocumentContract AX framework. In my case, I am also using Reporting framework. b. Let’s subscribe to the OnActivated event of the main DataSource which is DocuRef. This is so we can enable or disable printing by checking if the reference is a document and is of type ‘pdf’ c. Then we can create subscribe to the OnClicked event of the new button Print button. We will write our printing logic here. d. Once you click print, you’ll get the following message and you have managed to successfully print an attachment:

Write to a CSV file and save it

Image
This is a simple job I wrote in D365O that writes all customers where the DataAreaId is “USRT” to a CSV file and downloads it. When you run the job you will be prompted to save the file. Your saved file as CSV:

Change joinSource using event-handlers on form datasource

Image
Recently, I came across a requirement where I needed to change the join source on the RetailPackagePurch datasource of the PurchTable form from PurchLine to PurchTable . Standard showed the product package based on the selected purchase order line. Our goal was to show all product packages associated with the purchase order. This is the code that did the job: