Search Suggest

May 2023

Power BI Introduction Power BI Desktop | Power BI Service | Power Query | Data Modelling Data Visualization | Power BI Mobile Data Connectivity

Microsoft Power BI is a powerful and popular business intelligence and data visualization tool or suite developed by Microsoft. It enables users to transform raw data from various sources like Excel, SQL, OData, etc… into interactive and visually appealing dashboards, BI reports, and data visualizations. Power BI offers a range of features and functionalities that make it easier for individuals and organizations to analyze, explore, and share insights from their data. Tableau was considered one of the leading tools in the business intelligence world, but after introduced power BI by Microsoft, Power BI became more popular, this was due to its easiness of development and close integration with the Microsoft Office suite.

Key Components of Power BI:

1. Power BI Desktop

Power BI Desktop is the primary application for creating and designing Power BI reports and visualizations. Which is a Windows application, it provides a rich set of tools for data modeling, transformation, and visualization. Users can connect to various data sources, shape, and transform the data using Power Query, create relationships between different tables, and design interactive reports using a drag-and-drop interface. By using the Power BI desktop application, you can easily build queries, models and visualize data.

Power BI Introduction

2. Power BI Service

Power BI Service, also known as Power BI Online or Power BI Cloud, is a cloud-based platform that allows users to publish, share, collaborate, and access Power BI reports and dashboards from anywhere. It provides features such as data refresh, scheduled data snapshots, collaboration tools, and centralized data governance.

Power BI Introduction

3. Power Query 

Power Query is a data preparation and transformation tool integrated into Power BI. It enables users to connect to different data sources, combine and shape data, perform data cleaning and manipulation operations, and load the transformed data into Power BI for analysis.

Power BI Introduction

4. Data Modelling

Power BI allows users to create data models by establishing relationships between tables. It supports different types of relationships, including one-to-one, one-to-many, and many-to-many. Users can define calculated columns, measures, and hierarchies to enhance the data model and enable powerful analysis capabilities.

Power BI Introduction

5. Data Visualization

Power BI offers a wide range of interactive visualizations, such as charts, graphs, maps, tables, and matrices, to represent data effectively. Users can customize the visual elements, apply filters, create drill-down and drill-through experiences, and add dynamic interactivity to their reports and dashboards.

Power BI Introduction

6. Power BI Mobile

Power BI Mobile allows users to access their Power BI reports and dashboards on mobile devices. It provides a responsive and touch-friendly experience, enabling users to view and interact with their data on the go.

Power BI Introduction

7. Data Connectivity

Power BI supports connectivity to a vast array of data sources, including databases (SQL Server, Oracle, MySQL, etc.), cloud services (Azure, Salesforce, Google Analytics, etc.), Excel files, SharePoint, and many more. It provides both direct query and data import capabilities, allowing users to choose the most suitable option for their data analysis requirements.

Power BI offers various licensing options, including free and premium plans, to cater to different user needs and organizational requirements. It has gained popularity among business analysts, data professionals, and organizations of all sizes due to its user-friendly interface, powerful capabilities, and seamless integration with other Microsoft products and services.


cascade delete action in dynamics 365 finance and operations

When a Delete Action comes into the picture? Normally delete actions come into the picture when a user is trying to delete a database record. Delete actions are used to maintain the data integrity and consistency of the database. At the time of development, a developer must take care of the delete actions to implement in the project.

In Dynamics 365 Finance and Operations (D365 FO), the delete action refers to the deletion of a record from a table in the database.

When a record is deleted, it is permanently removed from the system and cannot be recovered. Therefore, it is important to exercise caution when performing this action and ensure that it is necessary and appropriate to do so. In D365 FO, the Deleted action can be performed using various methods, including:

  • Using the "Delete" button on a record's form.
  • Using the "Delete" command on a record's right-click menu.
  • Using X++ code to delete records programmatically.

It is important to note that some records in D365 FO cannot be deleted due to system constraints or dependencies on other records. In such cases, the system will prevent the deletion and display an error message. A delete action is performed when related tables are existing in the project, and deleting records from any table must be restricted for keeping the database consistent.

Imagine we have two tables. One is a product category table with the name PrdCategoryTable and another is a product table with the name PrdTable. Where PrdCategoryTable stores different product categories, and PrdTable stores the details of different products. PrdTable refers CategoryId of PrdCategoryTable as the reference key. So PrdCategoryTable is the parent table and PrdTable is the child table. PrdTable alone has no existence without PrdCategoryTable.  So, deleting any records from both tables must be restricted.

In Microsoft Dynamics 365 Finance & Operations, there are four types of Delete Actions.

  • None.
  • Cascade.
  • Restricted.
  • Cascade + Restricted

Read more: What are the different types of delete actions in Dynamics 365 fo

All four Delete Action methods have major roles in Dynamics 365 development process. In this article, I am going to explain the cascade deletion action property with a simple example.

Cascade delete Action.

In Dynamics 365 Finance and Operations, the cascade delete action refers to a feature that enables the automatic deletion of related records when a parent record is deleted. It is a database-level functionality that helps maintain data integrity and ensures that the database remains consistent.

When you configure a relationship between tables/entities in Dynamics 365 Finance and Operations, you can define the cascade delete action for that relationship. 

Setting up the Delete Action property to Cascade extends the functionality of Tables' delete method. The Cascade Delete action deletes all the records in the related tables where the primary key is equivalent to the primary key of the parent table. which means that deleting records from the parent table also deleting the child records from the child table where the primary key of the parent table matches the foreign key of the child table without any warning.

Add Cascade Delete Action in Dynamics 365 FO

At the time of development, a developer must take care of the delete actions to implement in the project. Here I will show you how to set a Cascade delete action in Dynamics 365 Finance and Operations. For this,

1. Create a normal relation

Imagine we have two tables one is a product category table with the name PrdCategoryTable which has three columns CategoryId, CategoryCode, and CategoryName, and another product table with the name PrdTable, which has four columns PrdId, PartNumber, Description, and CategoryId where PrdCategoryTable stores different product categories, and PrdTable stores the product details. Here PrdCategoryTable is the parent table and PrdTable is the child table.

PrdTable refers CategoryId of PrdCategoryTable as the reference key. PrdTable alone has no existence without PrdCategoryTable.

Once you created these two tables, you can read the article on how to create a normal relation in Dynamics 365 fo,

After creating the normal relationship between the above tables, we need to set the cascade delete action to the table, for best practice, you always set the delete action in the parent table.

Add a cascade delete action

For setting up the cascade delete action, you need to follow the below steps,

1. Expand the parent table PrdCategoryTable. Find the delete action node, and right-click delete actions.

Cascade Delete Action in Dynamics 365 FO
2. Then click New Delete Action and right-click the new delete action, and then click Properties.
Cascade Delete Action in Dynamics 365 FO
3. Select a related table in the table reference property from the Table property list. In our example select PrdTable. Select action property as Cascade.
Cascade Delete Action in Dynamics 365 FO

This is the basic setup for adding cascade delete action in Dynamics 365 finance and operations. Once you have done all the above steps, you need to build the project successfully. After the successful build of the project, Right-click on the table PrdCategoryTable and select Open Table Browser to open the table in the browser.

Wait for a minute, a table browser will open in the browser, and you can enter some dummy data into the PrdCategoryTable as shown in the below figure.

Cascade Delete Action in Dynamics 365 FO

Similarly, Right click on the table PrdTable and select Open Table Browser to open the table in the browser.

Wait for a minute, a table browser will open in the browser, and you can add some dummy data into the PrdTable as shown in the below figure. here I added some product records by referring to the CategoryId 1000 from the table PrdCategoryTable.

Cascade Delete Action in Dynamics 365 FO

Now we are going to test the delete action applied to the tables. For this, Delete a record from the parent table

Cascade Delete Action in Dynamics 365 FO

Here I deleted one record from PrdCategoryTable with CategoryId as "1000", because PrdTable refers to the category id 1000. If the deletion action is set or working properly, it will automatically delete the related data from the child table PrdTable.

Open the child table PrdTable and refresh the browser to refresh the data in the PrdTable. Now you can see all the related records from the child table PrdTable has been deleted automatically. Yes, the related records are automatically deleted from the child table, and the cascade deletes action is working properly.

Cascade Delete Action in Dynamics 365 FO

I think this article will be very useful for beginners and if the article is useful, please try to share it with your friends who are planning a career in D365 FO. In the next article, I will show you how to add restricted delete action in Dynamics 365 fo.

delete action different types of delete action in dynamics 365 finance and operations
When a Delete Action comes into the picture? Normally delete actions come in to picture when a user is trying to delete a database record. Delete actions are used to maintain the data integrity and consistency of the database. At the time of development, a developer has to take care of the delete actions to implement in the project. Then"How is the database consistency maintained?".

In Dynamics 365 Finance and Operations (D365 FO), the "Deleted" action refers to the deletion of a record from a table in the database.

When a record is deleted, it is permanently removed from the system and cannot be recovered. Therefore, it is important to exercise caution when performing this action and ensure that it is necessary and appropriate to do so.

In D365 FO, the Deleted action can be performed using various methods, including:

  • Using the "Delete" button on a record's form.
  • Using the "Delete" command on a record's right-click menu.
  • Using X++ code to delete records programmatically.

It is important to note that some records in D365 FO cannot be deleted due to system constraints or dependencies on other records. In such cases, the system will prevent the deletion and display an error message.

Actually, a delete action is performed when related tables are existing in the project, and deleting records from any table has to be restricted for keeping the database consistent. 

Imagine we have two tables PP_EmpTable and PP_EmpFamily, where PP_EmpTable keeps all the basic details of the employee, but PP_EmpFamily keeps the family details of each employee existing in the EmpTable. Here PP_EmpTable is the parent table and PP_EmpFamily is the child table.

EmpFamily Table refers EmplId as the reference key. PP_EmpFamily alone has no existence without PP_EmpTable. So deleting any records from both tables has to be restricted

In Microsoft Dynamics 365 Finance & Operations, there are four types of Delete Actions.

  •  None.
  •  Cascade.
  •  Restricted.
  •  Cascade + Restricted

All four Delete Action methods have major roles in Dynamics 365 development process.

Delete Actions in Dynamics 365 Finance and Operations D365 Snippets
Consider two tables PP_EmpTable and PP_EmpFamily tables, here EmpId is the foreign key for PP_EmpFamily which refers to PP_EmpTable. Now we are going to set the deletion action property to the table PP_EmpFamily.

In visual studio right click on the foreign key EmpId and go to the properties set the Related Table Property to PP_EmpTable as shown in the figure and select the On Delete Property to Cascade as shown below.

1. None

If you are choosing None, As the name shows None means Delete Action is disabled. In this case, while deleting records from the table nothing will occur on the related table.

2. Cascade

Setting up the Delete Action property to Cascade extends the functionality of Tables' delete method. The Cascade Delete action deletes all the records in the related tables where the primary key is equivalent to the primary key of the parent table. which means that deleting records from the parent table also deleting the child records from the child table where the primary key of the parent table matches the foreign key of the child table without any warning.



Delete Actions in Dynamics 365 Finance and Operations D365 Snippets

In our example, if we are deleting any record from PP_EmpTable it also deletes the matching records from the table PP_EmpFamily where the primary key EmpId matches the foreign key of the PP_EmpFamily.

Note: - Cascade Delete Action takes place both records are deleted through code or directly by the user through the user interface.

Read More:  Learn How to add cascade delete action in d365 FO

3. Restricted

Setting up the Delete Action property to Restricted also extends the functionality of the tables' delete method. In this case, the system checks that while deleting a record from the parent table first the system checks whether any related records exist in the related child tables if exist the system will generate a warning message. This warning message will generate only if the delete action is performed through the user interface.


Delete Actions in Dynamics 365 Finance and Operations D365 Snippets

Note: - A programmer can use .validateDelete() and this will return true or false values, based on the result, a developer can do the action.

As a result, super(), in validateDelete, checks whether records exist on related tables. If records do exist, validateDelete returns false. The forms system ensures that the deletion is not performed. In your own X++ code, check the return value of validateDelete. Don't delete the primary or related records if the method returns false.

Example :

On the VendTable table, a restricted delete action has been defined for the VendTrans table. When a vendor is deleted in the VendTable table, the validateDelete method ascertains whether transactions exist for the vendor in the VendTrans table. If so, validateDelete returns false.

4. Cascade + Restricted

Setting up the Delete Action property to Cascade + Restricted also extends the functionality of the tables' delete method. In this case, deleting a record from the parent table will show a warning and if we delete the record from the parent table also delete the related child records from the child table. 

As a result, super(), in validateDelete, ascertains whether records exist on related tables. Whether deleting records from forms or X++, if validateDelete returns false, the primary record isn't deleted and the cascading delete isn't performed. You should first delete the records in the related table before deleting the primary record.

If the primary record is being deleted as part of a cascading delete, the primary record and the records in the related table will be deleted.


Delete Actions in Dynamics 365 Finance and Operations D365 Snippets

Example

The Cascade+Restricted delete action is used in the standard application for LedgerJournalTrans on LedgerJournalTable.

This type of delete action is useful when you prefer a total clean-up—when you delete a customer, you also delete all the transactions associated with that customer.

In our example deleting records from PP_EmpTable also deleted the records from the related records from PP_EmpFamily. So here this property brings the functionality of both Cascade and Restricted.

Note: - However if the delete operation is done through X++ code it will not show any error and will delete the records from both tables.

This article explains the basic concept of delete action and what are the different types of delete action in D365 FO. In the next article, I will explain different types of delete actions in detail. if this article is useful, please try to share this with your friends.