Posts

Rename the DB name in SQL / D365F&O

Image
You just go to SSMS and write these 3 queries on your Database. In my case, I am working with  Microsoft Dynamics 365 Finance & Operations  Alter database AxDB set single_user with rollback immediate; Alter database AxDB modify name = AxDB_old alter database AxDB set multi_user;

Types of Keys in Relational Model (Candidate, Super, Primary, Alternate and Foreign)

Image
 In the context of a relational database, Keys are one of the basic requirements of a relational database model. keys are fundamental components that ensure data integrity, uniqueness, and efficient access. It is widely used to identify the tuples(rows) uniquely in the table. We also use keys to set up relations amongst various columns and tables of a relational database. Let’s explore the various types of keys used in a relational model, which are essential for organizing and querying data effectively. Why do we require Keys in a DBMS? Keys are crucial in a Database Management System (DBMS) for several reasons: Uniqueness: Keys ensure that each record in a table is unique and can be identified distinctly. Data Integrity: Keys prevent data duplication and maintain the consistency of the data. Efficient Data Retrieval: By defining relationships between tables, keys enable faster querying and better data organization. Without keys, it would be extremely difficult to manage large data...

Creating a class, the best practice way in D365F&O

 Some time ago, I shared my thoughts on the 'construct' pattern, which is commonly used in AX. While I often make use of it, it’s not without its flaws—it can actually violate some best practices. (I’ll cover the issue of deep class hierarchies resulting from this pattern in a future post.) First, it’s worth noting that you can customize the compiler level and the best practice checks it performs. To do this, compile something to bring up the compiler output window. Then, click the Setup button to adjust the settings. For this example, I used compiler level 4 and enabled all best practice checks. Now, let’s create a simple class. This class will simply display information from an InventTable record. 1. ClassDeclaration As we start designing this class, it quickly becomes clear that we need to declare an InventTable record as a member variable. /// <summary> /// Class written to test the construct and new... patterns /// </summary> /// <remarks> /// De...

HOW TO IMPORT A DATABASE (bacpac format) INTO YOUR CLOUD HOSTED ENVIRONMENT. (D365FO)

Image
HOW TO IMPORT A DATABASE (bacpac format) INTO YOUR TIER 1 CLOUD HOSTED ENVIRONMENT. (D365FO) BEFORE YOU IMPORT, MAKE SURE: 1. Move the new database (bacpac) into the system environment (local computer) from which you are importing. 2. Download the zip file of SQLPackage. NET Core for Windows from Download and install SQL Server | Microsoft Docs Link: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16 Ref: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16#windows-net-8 3. Extract the file by right-clicking on the file in Windows Explorer, and selecting 'Extract All...', and select the target directory 4. Open a new Terminal window/CMD and cd to the location where SqlPackage was extracted: SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200 You can also use the command below. C:\Program Files\Microsoft...

Azure Synapse anlytics

 What is Azure Synapse? Azure Synapse is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics. It gives you the freedom to query data on your terms, using either serverless or dedicated resources, at scale. Requirements An Azure Synapse database master key. Using Transact-SQL To create a database master key Choose a password to encrypt a copy of the master key that will be stored in the database. In Object Explorer, connect to an instance of the Database Engine. Expand System Databases, right-click master, and then click New Query. Copy and paste the following example into the query window and click Execute. -- Creates the master key.   -- The key is encrypted using the password "23987hxJ#KL95234nl0zBe".     CREATE MASTER KEY ENCRYPTION BY PASSWORD = '23987hxJ#KL95234nl0zBe'; Authentication The Azure Synapse connector uses three types of network connections:      1. Spark driver to Azure Synapse. ...

how to connect Just in time DB in D365F&O / Connect UAT Database with Dev machine in D365 F&O

Image
 Connect UAT with the Dev Environment Step 1: Go to LCS and select your UAT/ Tier 2 Environment  Path: Click on your Project Name from the Top of the LCS screen. Select your Environment full detail page Step 2: you should have to enable access for you VM to connect UAT DB. Click on Maintain -> Enable access Now Modify firewall rules form is open. Click on Plus button to add your VM ip address. Now go to your VM and find your ip address by just checking on chrome with "what is my ip" put your ipv4 ip address in the last open form " Add an Inbound Allow rule " in LCS put anything in the Name field and select Confirm. Now, you will get a popup from LCS. Step 3: Go to Database accounts table  field : Reason for access select Performance tuning for AX (Write to AX) field : Details put any comment Click on Request Access Refresh your page and you can see the DB detail on the " DATABASE ACCOUNTS" Tab copy all 4 keys to any notepad++ for clear readability. How...

How to remove deployed model in Tier2 environment in D365FO

 How to remove the deployed model in the Tier2 environment Dear all, I have an issue with the deployed model in the D365FO Tier 2 environment. I have some models in the development environment: Model A Model B Model C Model D I want to apply only Models A, B, and C for the Tier 2 environment. For the first time for deployment, I created a deploy package(including Model A, B, and C) in development and applied an update for the Tier 2 environment. However, yesterday, developer X on my team deployed a new deployment package(Model A, B, C, D). So today I could not deploy the package in Tier 2 with Models A, B, and C. Solutions: 1. Download the same package from the Asset Library that was previously deployed. Add File ModuleToRemove.txt (with model listed). Reupload to Asset Library and deploy to UAT. When I do this,  there's a warning on LCS that "it will first reinstall the model and then delete it. In order to not reinstall, delete the model from the package." 2. Create a n...