Integrate Dynamics 365 for Finance and Operations with CDS

Product:

  • Dynamics 365 for Finance and Operations
  • Common Data Service

Purpose:

The purpose of this blog is to demonstrate how we can integrate Dynamics 365 for Finance and Operations with Common Data Service (CDS).

Prerequisites:

  • Basic understanding of Common Data Service and PowerApps Admin Center

Steps:

Create a new custom entity for Vendor and add relevant fields

Create a new connection set in PowerApps Admin Center. Select Finance and Operations as the source environment and CDS as the target environment. Give in relevant organization details.

Create a new Data Integration Project in PowerApps Admin Center. Select Fin and Ops to CDS template.

Select the previously created connection set and then select the relevant organization.


Once the project is created, add a new task to the project, selecting the relevant source and target entities.

Configure field mappings.

Finally run the project.

Bingo! Data flows from Dynamics 365 for Finance and Operations to CDS.

You can schedule the Data Integration Project as well!

Advertisements

D365FO: The path is already mapped in workspace

Product:

Dynamics 365 for Finance and Operations

Purpose:

The purpose of this blog is to explain how can we resolve the version control workspace issue while working with Azure DevOps version control, previously known as VSTS or TFS.

Error:

The path % is already mapped in workspace %

Resolution:

First make sure that no other workspace is mapped to this path (including remote workspaces).

Sometimes the trick could be to clear the TFS cache on client machines

  1. Close all instances of Visual Studio on the client machine
  2. Manually delete the corresponding TFS client cache folder
  3. Start Visual Studio

The path to TFS client cache folder varies depending on the TFS version. Delete contents of the cache folder to resolve the issue:


Tfs 2017: “%localappdata%\Microsoft\Team Foundation\7.0\Cache\”
Tfs 2015: “%localappdata%\Microsoft\Team Foundation\6.0\Cache\”
Tfs 2013: “%localappdata%\Microsoft\Team Foundation\5.0\Cache\”
Tfs 2012: “%localappdata%\Microsoft\Team Foundation\4.0\Cache\”

AX 2012: Existing DIXF service for new AOS instance

Product:

Dynamics AX 2012

Purpose:

The purpose of this document is to explain what we can do to reuse a DIXF service of an existing AOS instance for a new AOS instance

Steps:

Copy paste the following files from the bin folder of an existing AOS instance to the bin folder of the new AOS instance:

  • DMFClientConfig.xml
  • DMFConfig.xml
  • Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.dll.config

D365FO: Data entity filter on enum field

To filter data entity using an enum field, we need to use a specific query expression syntax. For example, to filter Purchase order header data entity, PurchaseOrderHeadersV2, to get only ‘Confirmed’ purchase orders, we can add filter to DocumentApprovalStatus entity field which sources its value from VersioningDocumentState enum like below:

https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/PurchaseOrderHeadersV2?$filter=DocumentApprovalStatus eq Microsoft.Dynamics.DataEntities.VersioningDocumentState’Confirmed’

Untitled

As you can see below the query filter successfully filters Purchase order header entity to get only ‘Confirmed’ purchase orders:

Untitled

AX 2012: Create SSRS Line Chart Report

MakItemSalesHistory

 

Purpose:

The purpose of this document is to demonstrate how we can leverage the power of business intelligence through a simple SSRS line chart report.

Prerequisites:

  1. Visual Studio 2013
  2. Visual Studio 2013 tools.
  3. Reporting extension.
  4. Report Builder.
  5. Should be well-versed in Report Programming Model.

Business requirement:

Leverage business intelligence by analyzing sales trends for top item groups over the period of time.

Project overview:

MakItemSalesHistoryProject

Development:

We will be following the Report Programming Model to develop a precision design report.

1. Create an InMemory table, MakItemSalesHistoryTmp. This table will be used as a data set for the report in Visual Studio.

MakItemSalesHistory

2. Create an AOT query, MakItemSalesHistory. This query will be used in the Data Provider class to fetch records for the report.

MakItemSalesHistory

3. Create a data provider class, MakItemSalesHistoryDP. Bind the AOT query with it.

[
    SRSReportQueryAttribute(queryStr(MakItemSalesHistory))
]
class MakItemSalesHistoryDP extends SRSReportDataProviderBase
{
    MakItemSalesHistoryTmp  makItemSalesHistoryTmp;
}
[
    SRSReportDataSetAttribute(tableStr(MakItemSalesHistoryTmp))
]
public MakItemSalesHistoryTmp getItemSalesHistoryTmp()
{
    select makItemSalesHistoryTmp;
    return makItemSalesHistoryTmp;
}
private void insertTmpTable(SalesLine _salesLine)
{
    Qty                 qty;
    Date                shipDate;
    InventItemGroupItem groupItem;

    qty = _salesLine.QtyOrdered;
    shipDate = _salesLine.ShippingDateConfirmed;
    groupItem = InventItemGroupItem::findByItemIdLegalEntity(
        _salesLine.ItemId,
        _salesLine.DataAreaId);

    ttsBegin;
    makItemSalesHistoryTmp.clear();
    makItemSalesHistoryTmp.ItemId = _salesLine.ItemId;
    makItemSalesHistoryTmp.ItemGroupId = groupItem.ItemGroupId;
    makItemSalesHistoryTmp.Price = _salesLine.salesPrice;
    makItemSalesHistoryTmp.Amount = _salesLine.SalesPrice * Qty;
    makItemSalesHistoryTmp.Qty = qty;
    makItemSalesHistoryTmp.Year = year(shipDate);
    makItemSalesHistoryTmp.MonthOfYearId = mthOfYr(shipDate);
    makItemSalesHistoryTmp.Days = dayOfMth(shipDate);
    makItemSalesHistoryTmp.insert();
    ttsCommit;
}
[SysEntryPointAttribute(false)]
public void processReport()
{
    Query                   query;
    QueryRun                queryRun;
    QueryBuildDataSource    qbds;
    QueryBuildRange         qbr;
    SalesLine               salesLine;
    InventItemGroup         ItemitemGroup;

    query = this.parmQuery();
    qbds = query.dataSourceTable(tableNum(InventItemGroupItem));
    qbds.name("InventItemGroupItem");

    qbr = qbds.addRange(fieldNum(InventItemGroupItem, ItemGroupId));
    qbr.value(strFmt('((%1.%2 == "Speakers") || (%1.%2 == "Television"))',
        qbds.name(),
        fieldStr(InventItemGroupItem, ItemGroupId)));

    queryRun = new queryRun(query);

    while (queryRun.next())
    {
        salesLine = queryRun.get(tableNum(salesLine));
        this.insertTmpTable(salesLine);
    }
}

4. Create a controller class, MakItemSalesHistoryController. You can observe, how the report dialog has been suppressed in the controller.

class MakItemSalesHistoryController extends SrsReportRunController
{
}
static void main(Args _args)
{
    MakItemSalesHistoryController controller;

    controller = new MakItemSalesHistoryController();
    controller.parmReportName(ssrsReportStr(MakItemSalesHistory, LineChart));
    controller.parmArgs(_args);
    controller.parmShowDialog(false);
    controller.startOperation();
}

5. In Visual Studio 2013

  • Create a new Project
  • Add new Report to the solution.
  • Add new Dataset, MakItemSalesHistoryTmp, of type Report Data Provider.
  • Choose MakItemSalesHistoryDP class in the Query.
  • Add new precision design, LineChart, to the report Designs node.

MakItemSalesHistory

6. Edit LineChart using Designer.
7. Insert a new Chart report item from the Toolbox.

MakItemSalesHistory

8. Double click on the chart area to open the field editor, add the following fields as specified.

Field Drop area
Year, MonthOfYearId Category
ItemGroupId Series
Qty Data

9. Next, you can improve the aesthetics of the chart, as it pleases, by updating different chart properties available out of the box in Visual Studio.
10. Save, build and deploy the report.
11. Create an output menu item and bind it with the SSRS report.

MakItemSalesHistory

12. Add menu item to Sales and marketing > Reports > Sales orders > Item sales history.
13. You should be able to see the report in the Report viewer.

MakItemSalesHistory

AX 2012: Automated build deployment process

Purpose:

The purpose of this document is to describe how we can deploy automated builds to different Dynamics AX pre-production environments so that newly developed features could be rolled-out for UAT. The document also illustrates how version controlling by TFS and data migration activities fit into the big picture.

Business requirement:

Ability to release, deploy automated builds to different Dynamics AX pre-production environments to roll-out newly developed features, bug fixes for testing.

Assumptions:

  • Dynamics AX Management Utilities have been installed and configured.
  • Build scripts have been installed and configured.

AX pre-production servers topology:

ax-pre-production-environments

Process:

  1. ISV model server (Optional)
    1. Only applicable when an ISV model needs to be updated in the next build.
    2. TFS Force sync.
    3. Perform full compile, full CIL, DB synchronization.
    4. Export ISV model.
  2. Build server
    1. Must have 2 AOS instances, build and deploy. Both must not be connected to TFS.
    2. Copy ISV model to file system.
    3. Uninstall existing ISV model from build instance.
    4. Uninstall existing ISV model from deploy instance.
    5. Install new ISV model to build instance.
    6. Install new ISV model to deploy instance.
    7. Restart AOS service of build instance.
    8. Restart AOS service of deploy instance.
    9. Perform full compile, full CIL, DB synchronization on build instance.
    10. Perform full compile, full CIL, DB synchronization on deploy instance.
    11. Run build command, buildax.ps1, on build instance.
      1. Output is CUS model file created on the file system.
    12. Run deploy command, deployax.ps1 on deploy instance.
      1. Output is modelstore file created on the file system.
  3. ConsTest server
    1. Copy modelstore file to file system.
    2. Import modelstore file via powershell.
    3. Restart AOS service.
    4. Perform full compile, full CIL, DB synchronization.
  4. Document newly developed features and bug fixes in release notes.
  5. Email the notification and release notes to business stake holders.