Tuesday, February 14, 2017

Dynamics 365 & Office Integration Series - PART 1 - Odata Queries Through Dynamics 365

This article series is about integration practices between Dynamics 365 and office apps.  Integrations have been explained in 4 posts:


Let's get started with PART 1

CONTENT

Introduction
Some of Odata Query Structures
Examples

INTRODUCTION

In Office Integration Series, articles will be providing information about how Dynamics 365 is integrated with the office app.

Dynamics 365 is giving an environment to work as productively as possible by reinventing productivity and business processes.  One of the ways is using Microsoft Office. Microsoft made office one of the pieces of the user interface for Dynamics 365. Some platforms Dynamics 365 is using are Odata and Azure blob storage.

Odata (Open Data Protocol): Data entities are table groups of top of the one or more tables. In other term, entities are a bit of views. They are used for import & export via Odata with the excel app and word app and document generation capabilities. Third-party applications can also use Odata. Odata represents the data in JSON formats. You can open JSON files by using notepad.

Azure blob storage: Not only something that is used for storing document attachments for document management, but also is used as a kind of transition between the system and the user. So when files get generated they get put into the azure blub storage and then the user gets navigated to those and browsers (chrome, internet explorer) deliver those to them.

SOME OF ODATA QUERY STRUCTURES

Odata queries: Type the following queries on your browser's address bar. Prepare your query in accordance with your environment's data.

Metadata - https://<environment>/data/$metadata
Data - https://<environment>/data/<EntitySet> e.g. Customers
Functions - https://<environment>/data/<EntitySet>/$count

In the next part of the article, we will query the following customers in different ways.



EXAMPLES

Let's see how queries work

Query - Metadatahttps://usnconeboxax1aos.cloud.onebox.dynamics.com/data/$metadata



This metadata feed is publicly accessible. But the following queries are not publicly accessible.

Query - Customers - https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/Customers



Note that a JSON file has been prompted by the Odata service.
Save and open it with notepad for each private query.

This is the raw Odata feed for customers.



Since appearance is complicated, we can simplify  it in order to see only the customer names.

https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/Customers/?$select=Name



We can also add another column to simplify customer name query. We need to put %2C before for each additional field. 

In order to add customer number, we put %2CCustomerAccount statement at the end of the query.

https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/Customers/?$select=Name%2CCustomerAccount



We can do some interesting things as well. Let's count how many customers we have.

Query - Functions - https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/Customers/$count



So system is able to represent the total number of customer account here as well.



Tuesday, February 7, 2017

Dynamics 365 Data Import/Export by Considering Your Business Purpose

This article series is about integration practices between Dynamics 365 and office apps.  Integrations have been explained in 4 posts:


Let's start PART 4

You can use excel for different purposes in Dynamics 365 like preparing reports, data update, transactional opening, master data management and so on. This article explains the key features of excel and Dynamics 365 integration and provides information how Dynamics 365 integrates with Excel using different approaches and how Excel can become a core part of the user experience.




STATIC EXPORT TO EXCEL

Static Export to Excel provides a quick mechanism to get the data in grids on a form. The standard mechanism for triggering Export to Excel in Dynamics 365 is via the Open in Microsoft Office menu. Static Export to Excel is also available via a right-click context menu on the grid. It is not our main subject in this article. 

Use this feature to export your data into excel and prepare reports.

GENERATED OPEN IN EXCEL

The open in Excel experiences are editable and refreshable via the Excel Data Connector App. Excel data connector app is a replacement for Excel add-in that you would have known from AX 2012. It leverages the Odata services and then there are other things inside of it. Once the excel app launches, you can sync data, make updates, add or delete data. The open in Excel experiences are listed under the open in Microsoft Office menu as well.

Little info regarding excel data connector app: This app is built using the new apps for Office framework, and it provides a JavaScript-based Web API for apps to communicate with Office applications.  And the biggest advantage to this new framework is that the apps can run inside of Excel on-premise for Windows in addition to Excel Online and Office 365 as well as Excel on the iPad.  And other Excel apps will be supported in the future.  So this app leverages OData feeds based on underlying data entities and allows inserting, updating, and deleting data so users have the ability to publish data back to Dynamics 365.
----------------------------------------------------------------------------------------------------------------------
Publishing Route
Excel > Office Web Add-in (JS + HTML) > JavaScript OData API (Olingo) > Authentication through Azure Active Directory (AAD) > AX OData services on the AOS > AX Entities > AX LINQ provider > AX Database 
----------------------------------------------------------------------------------------------------------------------
When an entity has the same root datasource (table) as a form, it will be added as an option in the Open in Excel section of the Open in Microsoft Office menu. This is referred to as a “generated” option. Note when you click on office menu in Dynamics 365, you will also see “(unfiltered)” statement after the entity name. Currently no filter is added to these options, hence the term “(unfiltered)”. In the future, an attempt will be made to apply the filter from the form to these options. For example, if a list of Customers was filtered to just Customers in the state of California, then, in the future, the entity will be scanned for the state field and if it was found then a filter would be automatically added. 

Use this feature to export your data into excel and make changes and publish the document back to AX 365.

ENTITIES

Entities help us for managing master data. Data entity is a collection of multiple tables. For example, in normalized tables, a lot of the data for each customer might be stored in a customer table, and then the rest might be spread across a small set of related tables. In this case, the data entity for the customer concept appears as one de-normalized view, in which each row contains all the data from the customer table and its related tables. 

Use this feature to import/export master data and opening balances and other opening transactional data.

Understanding Audit Trail and Audit Workbench in Dynamics 365 Finance and Operations

UNDERSTANDING AUDIT TRAIL AND AUDIT WORKBENCH IN DYNAMICS 365 FINANCE AND OPERATIONS This article serves as a comprehensive discussion on th...