Posts

[D365] Accessing database for a tier 2 sandbox environment

Image
When working with Sandbox environments, we can not RDP to the environment access the database as we would normally do for a Tier 1 environment.  In order to access the database we can follow these steps Navigate to the LCS environment details page for the sandbox environment Under the manage environments tab page you should have a section titled 'Database accounts' as shown below Select the appropriate option and provide a justification in the details text box. Click Request Access Once done, you may be prompted as follows After this you will be able to access the database credentials under the database accounts within the environment details page in LCS. You may need to refresh the page to view this information. Once you have the SQL database credentials, you will need to Manage > Enable access to enable access for your network using which you would be accessing the database. A new dialog will be displayed that allows modification of firewall rules. Click add. Select se...

Migrate existing apps from Classic Application Insight after it's deprecation

Image
 Microsoft is retiring the Classic Application Insights on 29 February 2024. We’re retiring Classic Application Insights on 29 February 2024 | Azure updates | Microsoft Azure Microsoft has described the steps required for transition in this article. Migrate an Application Insights classic resource to a workspace-based resource - Azure Monitor - Azure Monitor | Microsoft Docs In this article I will be going over how we can move from Classic Application Insights to Workspace-Based Application Insights for existing solutions. To switch we need to deploy a new application insights resource within our existing resource groups Ensure to select workspace-based as shown below Once the new application insight has been created, we can use the new instrument key to connect our existing solution to the new application insights Next, select change your resource Select the application insight created above and click apply Once this is done all telemetry will be redirected to this new resource.

Query execution using x++

 In this article I will be going over how we can write a code based query to retrieve and filter data from the database without having to write a select statement. For this example, I am going to extract the customer and sales order information for a specific customer. Query query = new Query(); QueryBuildDataSource salesOrderQueryBuildDataSource = query.addDataSource(tableNum(SalesTable)); // add range for sales order with Id 1003 salesOrderQueryBuildDataSource.addRange(fieldNum(SalesTable, SalesId)).value(queryValue('1003')); // join the customer table to retrieve the customer details QueryBuildDataSource custTableQueryBuildDataSource =      salesOrderQueryBuildDataSource.addDataSource(tableNum(CustTable)); // add join type custTableQueryBuildDataSource.joinMode(JoinMode::Exists); // add join link custTableQueryBuildDataSource.addLink(fieldNum(SalesTable, CustAccount), fieldNum(CustTable, AccountNum)); // initiate query execution QueryRun queryRun = new QueryRun(qu...

Dynamics 365 F&O Development Beginners Guide

Image
This article is part of a series that I will be doing for beginners to gain a preliminary understanding of how to do development for dynamics 365 Finance and Operations.  To get started we need a development environment. The following video posted by Microsoft will give you all the required information for setting up your development environment. https://www.youtube.com/watch?v=cqp9MetfiyM It is important to note that your Visual Studio instance is always in admin mode while developing. When we are inside the visual studio development studio we can see a new  'Dynamics 365' file menu. Note in Visual Studio 2019, the Dynamics 365 Menu is inside the 'Extensions' file menu. Everything that we require for our development purposes can be found here.  For this demonstration I am using Visual Studio 2019. The Dynamics 365 Menu has the following menu items.  The following section described each menu item. I will only be discussing on the menu items that are required for a be...

New Commerce SDK Overview

Image
In this article I will be giving an overview of the new Commerce SDK. The Microsoft Dynamics 365 for Commerce team have updated their release process for the Commerce components. All releases are now pushed through their GitHub repository. The following repository contains the latest releases from the commerce team.  GitHub - microsoft/Dynamics365Commerce.InStore: Repository for hosting the Dynamics 365 Commerce in store Samples The details of the structure and files have been explained on their GitHub  repo. Release Branch For each release a new release branch is released within the GitHub repo. For example, Branch release/9.34 points to 10.0.24 Branch release/9.35 points to 10.0.25 repo.props file Within the repo, the repo.props file found at the root of the directory contains the release details that will enable us to connect to correct release packages from the Microsoft Nuget feed. Dynamics365Commerce.InStore/repo.props at release/9.35 · microsoft/Dynamics365Com...

Create a zipped file using x++

 This article explains how we can create a zipped file in x++ and allow the file to be downloaded using the browser download. For this example, I am adding a csv file to a zipped archive. First we will need to create a stream with the contents for the csv file. CommaStreamIo streamIO = CommaStreamIo::constructForWrite();   streamIO.writeExp('Id', 'Title'); // These will represent the header of the csv file  streamIO.writeExp('001', 'Science'); // Row 1 streamIO.writeExp('002', 'Nature'); // Row 2 Next, we can generate the csv file contents and add it to a zip archive. // Get the stream System.IO.Stream        stream              = streamIO.getStream(); const str               extensionCsv        = '.csv'; c...

Generate and download a csv file using X++

Within Dynamics 365 HQ we often need to be able to export data as a csv file. This article explains how we can generate a csv file. The following lines of code can be used to create and download a csv file Create a writable stream. CommaStreamIo streamIO = CommaStreamIo::constructForWrite();   streamIO.writeExp('Id', 'Title'); // These will represent the header of the csv file  streamIO.writeExp('001', 'Science'); // Row 1 streamIO.writeExp('002', 'Nature'); // Row 2 // Get the stream System.IO.Stream        stream              = streamIO.getStream(); const str               extensionCsv        = '.csv'; stream.Position = 0; // StreamReader to read as str System.IO.StreamReader...