Posts

Showing posts from 2017

Deploy Reports in Dynamics 365 for operations

Image
Hi Everyone, Wanted to share quick notes  about deploying SSRS reports in dynamics 365 for operations. Deploying all reports Using PowerShell All reports can be deployed using following commands . To run command open PowerShell as administrator  and run following commands Depending on path in your virtual machine you can switch between C and J drive J:\AosService\PackagesLocalDirectory\Plugins\AxReportVmRoleStartupTask\DeployAllReportsToSSRS.ps1 -PackageInstallLocation "J:\AosService\PackagesLocalDirectory" Deploying a specific Reports through PowerShell Now I want to deploy reports starting with AssetDep and TaxVatRegister , so I ran following command and in the output you can see only those reports get deployed. This trick is helpful in managed environment like UAT not prod when you have some issues with reports in those enviornments. J:\AosService\PackagesLocalDirectory\Plugins\AxReportVmRoleStartupTask\DeployAllReportsToSSRS.ps1 -Module ApplicationSuite -Repor

Integration With Dynamics 365 For operations using OData proxy generator.

Image
In This blog post we are going to look at how to expose and consume data entities in the new OData v4 endpoint in Dynamics 365 for Operations. We will mainly focus on three task ·       Customize/Use a data entity provided by Microsoft. ·       Register a new application in Azure Active Directory. ·       Implement an OData client to consume OData services, including creating a proxy library for the Microsoft AX OData endpoint. We are going to create simple Inventory movement journal as an example  Using out of the box available entities   InventoryMovementJournalHeader and InventoryMovementJournalEntry . Customize Microsoft provided data entity To make data entity available on Odata endpoint its isPublic property must be set to true. So for any standard entity you must change this property if it’s not already set to yes to make it available  on endpoint. When you create any new entity make sure you set isPublic = true so that its available on oDATA endpoint. In my scenario I a

D365FO Send Report as email attachment

Hi All , Usually in any implementation project we get request to send Report as a attachment in email.  Below is code going to help you to send  report as an email attachment.  In the below code I am saving report in report archive(DocuRef table ) reading it from DocuRef table  in to bytes and converting it in to memory stream. The memory stream is further I am going to use to  send an email with Subject and body using SysMailerMessageBuilder class. You can use following methods of this class setSubject - To set Subject of the email. setBody -  To Set email body . setFrom - To set sender of the email. sendInteractive - To send interactively. sendNonInteractive - TO send non interactively Args args; SalesInvoiceContract salesInvoiceContract; CustInvoiceJour custInvoiceJourLocal; SRSPrintDestinationSettings SRSPrintDestinationSettings; #SRSFramework

Running runnable class through URL in Dynamics 365 for Operations

Hi Everyone , There are multiple ways you can run Runnable class. One way is we can attach it to Menu item and add it to any form and execute it using menu item. Another way is set it up you project as startup object and runnable class as startup object in Visual Studio and run it from Visual studio. Another way of running it is from your browser (IE/Chrome). https:// URL> /?cmp= &mi=SysClassRunner&cls= Parameters: Cmp = Your company name e.g USMF Cls = Your Runnable class name e.g. ShowInvoicedOrderCount https://usnconeboxax1aos.cloud.onebox.dynamics.com/?cmp=USMF&mi=SysClassRunner&cls=ShowInvoicedOrderCount Whenever you want to quickly verify anything this way is very useful and you don’t have to spent time seeing while visual studio opens diagnostic tool and load other windows.

D365FO Use of FileUpload control to Read CSV file

Image
In Dynamics Ax implementation very often we get requirement to upload data using csv files. Although  in Dynamics 365 for operations it can be easily done using data entities and data packages, in this blog we will see how can we use new FileUpload control and design classes to read, download files. In   Dynamics 365 for operations  application runs on cloud and the client is in web , so Microsoft has introduce new process to read files using Azure blob. When we upload file, that file gets uploaded to Azure blob and we have to read that file from Azure blob to retrieve data. Design classes: There are two main types of classes that developers can work with for the file upload control: Upload strategy class  – This class lets developers control various parameters that should be enforced for uploaded files, such as the types of files that a user can upload and the maximum size of a file. It also lets developers determine where and how the uploaded file s

Read Files from Zip Folder in D365 using System.IO.Compression Namespace

Hi All , In this blog post we will see how to use System.IO.Compression Namespace to read files from Zip folder. The System.IO.Compression namespace contains classes that provide basic compression and decompression services for streams. I came across requirement where I had to read files from zip folder containing data for payroll and import it in Journals. Following piece of code will give you idea about how to use compression namespace to get count of the files with in folder , how to  extract file from zip folder and copy to stream object which can be used further for reading content of the file. void processZipFile() { #File FileUpload fileUploadControl = this.getFormControl(dialog, FileUploadName); FileUploadTemporaryStorageResult fileUploadResult = fileUploadControl.getFileUploadResult(); if (fileUploadResult != null && fileUploadResult.getUploadStatus()) { zipFileName = fileUploadResult.get

Generate Drill through link/Hyperlinks for SSRS report in D365

Here is new way to generate hyperlinks for SSRS reports in D365O For the action on the textbox: =Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GenerateDrillThroughLink( Parameters!AX_ReportContext.Value, Parameters!AX_UserContext.Value, drill target menu item,  drill target menu item type,  table name,  field name,  [field name, field value]) drill target menu item The name of the menu item target for the hyperlink drill target menu item type The type of the menu item target for the hyperlink (e.g. “Display”) table name The name of the table referenced by the target menu item field name The name of the field in the table to restrict field value The value of the field in the table to restrict Optional Additional table name and field name pairs as needed Example: =Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GenerateDrillThroughLink( Parameters!AX_ReportContext.Value, Parameters!AX_UserContext.Value, "MenuItemname", "Display", "CustInvoiceJour