Collections in C#

The .NET Framework contains different types of collections that can be used to store and retrieve data. In this post we will look at the different types. Collections consist of: Queue Stack ArrayList List LinkedList Dictionary Each collection type has different benefits. Collections in the .NET Framework are in: System.Collections System.Collections.Generic Queue A queue is a FIFO (first in first out) list. You can think of this as like a … Continue reading Collections in C#

Dynamics GP Trial Balance

Dynamics GP has a Trial Balance report you can run. To run the report, go to Reports->Financial->Trial Balance: This will open a window where you will have different options on reports to run: Select Detailed->Demo and Modify and it will open the window below: You have the ability to specify which what to include, the year, sorting etc. I have selected Start and End of Fiscal Year as the date range. Select … Continue reading Dynamics GP Trial Balance

Dynamics 365 Using EntityReference to Get Name from Id

When connecting to Dynamics 365 from code, you can retrieve records of an entity through RetrieveMultiple. When using RetrieveMultiple, you specify the columns you would like to retrieve using a ColumnSet. Either specify the columns like this: ColumnSet columnSet = new ColumnSet(“name”, “opportunityid”, “parentaccountid”); Or retrieve all columns like this: ColumnSet columnSet = new ColumnSet(true); In some cases, the columns retrieved will be an Id. For example, when retrieving Opportunities, … Continue reading Dynamics 365 Using EntityReference to Get Name from Id

C# Interfaces

The purpose of Interfaces in C# is to define a contract. Any class that then implements the interface will know which methods it needs to have. An interface is like an abstract class, but without any implementation. Let’s look at an example. Let’s say we have a Vehicle interface, like below. A Vehicle will have wheels. If this were an abstract class, we could define the implementation of HowManyWheels, for … Continue reading C# Interfaces

Unified Service Desk – Default Action

Most Unified Service Desk controls have a “default” action. This action performs an action called default. In cases where the control does not have a default action, running this action will load the control. For example, let’s say we have a custom hosted control called “Dashboard” of type CRM page. We can run the default action from the debugger: This will open the hosted control:  

Using DAX PREVIOUSYEAR

We can also perform time intelligent functions on our date fields in DAX. Let’s compare this year’s sales to last year’s sales. We will create a new measure for previous year sales. First, let’s create a date table. This is created in Power BI Query Language (M): Next, create the measure. We are calculating the sum of the extended price, in the previous year, using the PREVIOUSYEAR function: What this means, is … Continue reading Using DAX PREVIOUSYEAR

Using DAX Single Date Functions

Some DAX functions will return a single date. Let’s go through some of these with our dataset. STARTOFMONTH If we apply this to our data without a filter, it will find the start of the first month: LASTDATE ENDOFQUARTER Applying this to 2016, it uses the first 2016 record (09/02/2016) and gets the end of that quarter:  

DAX Calculated Columns

Let’s start with a dataset that has sales orders. There are sales order lines: And the data looks like this: However, there is no extended price in this dataset. To calculate it, let’s add a new calculated column. Click on the ellipse on the dataset: And select New column: Add the formula: The new column will appear in the dataset: And the new column can be added to our Power BI … Continue reading DAX Calculated Columns

Introduction to DAX (Data Analysis Expressions)

DAX, or Data Analysis Expressions, is a library of functions, formula and query language used in analytics. It is used in: Power BI SSAS Tabular models (SQL Server Analysis Services) Power Pivot in Excel To write DAX formulas in Power BI, open Power BI Desktop and go to your dataset. In the example below we have Transactions: Click on the Ellipse next to the dataset and you will see “New measure” … Continue reading Introduction to DAX (Data Analysis Expressions)

Unified Service Desk – Navigate Action

In Unified Service Desk, we can use the Navigate action to navigate in our controls. For example, let’s say we have a control that displays a CRM Page, called Dashboard: The control shows as empty as we have not specified the page to load. The Navigate action specifies the URL to navigate to: Or to a webpage: