Fix to change Dynamics 365 – database to multi user mode

Sometimes when you try to restore the AX database, it will be converted into a Single User mode. And it will now allow you to perform any task against the AX database.

b1

To rectify that, please try to execute the below query.

ALTER DATABASE AXDB SET MULTI_USER WITH ROLLBACK IMMEDIATE

If you have any deadlock on the database, you will receive the below error.

2

To rectify this issue, we need to kill the dependent process on the database. To identify the process please use the below sql script.

  1. Get the database id

(select dbid from sysdatabases where [name] =’AxDB’)

3

  1. Find all the process on the database id

select spID from sysprocesses where dbid IN 5

Once, you find the spID of the process, you should kill the process by using below code

Kill <spID>

Now execute alter table to change the database to multi user mode using below query.

ALTER DATABASE AXDB SET MULTI_USER WITH ROLLBACK IMMEDIATE

Alternatively, you can use the below script to find lock processes

4

SELECT * FROM   sys.dm_tran_locks WHERE  resource_database_id = DB_ID(‘AxDB’)

And kill the process with the request_session_id as shown below code

kill 53

kill 51

ALTER DATABASE AXDB SET MULTI_USER WITH ROLLBACK IMMEDIATE

How to consume Dynamics AX Product Images in PowerApps

Step 1: Create a sample data entity as shown below. It uses EcoResProductImage table which holds the image container of the items.

1

Step 2: Check the odata feed in the browser. You can see the Base64 images are exposed in “MediumSize” field as shown below.

2

Step 3: Create a sample PowerApps application and add a gallery. Assign the data source to the gallery.

4.png

Step 4: Assigning the “MediumSize” to the image will not shows up the image in PowerApp. So add the below code in the image source to specify the Base64.

“data:image/jpeg;base64,” & ThisItem.MediumSize

3

 

Read Query String in Dynamics 365 Operations – AX 7

Challenge: To read query string parameter in form init() method

Solution: URLUtility class is used to extract the query string parameters. To explain this, I have created a simple form designed to extract query string in the init method and display in a text control.

  • A display menu item is attached with the form “Form1”

d1

  • A string control is attached and the “AutoDeclaration” property is set to “Yes”. Assign custom pattern to the form.

d2

  • Below code in the form init() method retrieves the query string information and set to the string control.

D3

  • Execute the menu-item linked with the Form and attach the following line in the url link

&queryParm=Hello,world

D4

  • The query string value is displayed in the text control.

How to add Batch Server to a Batch Group in D365 Operations

Issue Tag 1: Batch job is not executing properly in D365 operation

Issue tag 2: Batch job remains in waiting state forever

Reason: The issue is due to the wrong or non-assignment of batch server for the batch job

Step 1:

Navigate to Batch Server -> Batch groups -> Batch job

Create a batch group. Navigate to “System administration” –>  “Batch Groups”

1

Click on “New” and create a batch group in the following form.

2

Use the arrow icon to set the selected servers.

3

Now, the batch job will be executed from the waiting stage.

Check here as well:

Sometimes the batch will still remain in the waiting stage even after you have configured the servers as mentioned above. This is because the batch server is not started in the MS services.

Please open cmd prompt and type Services.msc.

Search for “Microsoft Dynamics 365 Unified Operations : Batch Management Service” and start the process.

6

Basic Power BI report with Cross filter functionality and Edit interaction

Level : Beginners

Agenda: This blog explains the creation of basic Power BI report using cross filter functionality and edit interactions.

16

Prerequistics : Power BI desktop, Excel sheet with input data

Downloadable Contents : Input – Excel File

 

Illustration

We are going to design Power BI report for employees. We have an excel sheet with two tables, in which table 1 has the personal information of the employee whereas table 2 will have the salary information of the employee. These two tables are linked with “Employee ID” field.

Table 1:

1

Table 2:

2

Step 1: Open the Power BI Desktop software and click “Get Data” –>  “Excel”.

3

Step 2: Open dialog box allow user to select the input file in excel sheet format. Select the input file and click OK.

4

Step 3: Navigator form appears as shown below. It allows user to select the input data from the excel workbook that was selected. Tables and sheets in the input workbook will be populated. Click “Load” button to load the data into Power BI.

5

Step 4: Select the “Relationships” button as highlighted below.

6

Step 5: The line between the table 1 and table 2 describes the relationship between them. Power BI will automatically match the column name and detects the relationship between each other. Table 1 has unique record for the employee and Table 2 has many records for each employee. So it’s a one-to-many relationship.

7

Step 6: Cross filter direction has two options – “Single” and “Both”. Let’s create a report for the “Single” cross filter direction.

8

Step 7: Navigate to the “Report” button to design the report.

9

Step 8: Drag and drop the “Tree Map” control and assign the values as shown below. Assign “Employee ID” from table 1 into “Group” property and assign “Sum of Age” in Values property.

10

Step 9: Drag and drop “Pie chart” as shown below. Assign “Legend” with “Employee ID” from Table 2 and assign “Salary” from table 2 in Values property.

11

Step 10: Click on any one boxes in the “Tree map”. You will notice that the data from Table 2 is also filtered in “Pie chart” as sub set.

12

Step 11: To change the interaction between two elements, there is a provision in Power BI to toggle the filter view. Click on Tree map and select “Format” –> Edit Interactions” option.

13

Step 12: This will show option to edit the interaction in each chart. Select the filter option in pie chart as shown below.

14

Step 13: When you select the box in “Tree map”, the pie chart will automatically filter itself instead of highlighting it.

15

Step 14: If you select a pie in Pie chart, the data in the tree map is not filtered or highlighted.

16

Step 15: This is because, the cross filter condition is assigned as “Single”. Change the filter condition as “Both” in relationship tab as shown below.

17

Step 16: Select the report design and click on a pie in Pie chart. The tree view will be automatically filtered as shown below.

18

Homework

Create a report with the same input file.  Create a pie chart for Gender and create a table below to show the list of employee name that are selected. When user selects any record in grid, the pie chart should also filter itself.

19