DAX 2012 R3 CU9 Retail database version mismatch and GAC issues

When upgrading the Contoso AX 2012 R3 CU8 to AX 2012 R3 CU9 and then trying to open the ePOS, you might get the following error. “Database version mismatch. You must either apply a Retail POS hotfix or upgrade the Retail POS database

In the event viewer you might see the following:

A TechNet article gave me some indications that the issue was related to the CreateDatabase.dll in the Retail Channel Utility.

My trick to make this work again was to open the installation folder for CU9, and apply the retaildatabaseutility.msp

This upgraded the CreateDatabase.dll to include upgrade to version 6.3.105

When I then re-run the Retail Channel Configuration Utility on the channel database and on the offline database

After successfully upgraded the channel database, when trying to startup the POS, I get the following error; Could not load type ‘Microsoft.Dynamics.Retail.Notification.Contracts.SignatureCaptureConfirmation’ from assembly ‘Microsoft.Dynamics.Retail.Notification.Contracts, Version=6.3.0.0, Culture=neutral..

And the POS screen shows no login, just the following “corrupted” screen.

I raisted a service request to Microsoft, and I got my answer today. It is related to All .NET applications will check first if the required assembly is available in the Global Assembly Cache (GAC) before searchin in the AppBase folder.

If we look at the C:\Windows\Microsoft.Net\assembly\GAC_MSIL we see the following

The date is older than the CU9. Microsoft explained me that this issue occures, because we have a “one-box” installation, and As we didn’t redeploy the Online Store after upgrading to CU9, the old assemblies were still in the GAC, causing the error. This would not come up in a real situation where all components are installed in separated server, but with this being an all in one environment we had this side effect.

The solution is therefore to uninstall the assembly from the GAC.

1. Check that GACUTIL is located at C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools in the VM-image

2. Run the command “gacutil /u Microsoft.dynamics.retail.notifocation.contracts”

You may need to do this for all Microsoft.dynamics.retail.* in the GAC_MIL folder

Then you can start the ePOS as expected J

Thank you Microsoft J

DAX 2009 – Shipping overview, a mirror of arrival overview

Image

Dear AX 2009 customers. You are not forgotten, and Microsoft have support options available until year 2021 J. I wanted to write a blogpost to show that there still happens a lot of local innovation at the customers that are relying on this version of DAX.

Often, when we talk about purchase orders and sales orders, we often refer to them as mirrors. On the transaction level Purchase and sales can be seen as mirror processes, with just the opposite sign. But in standard AX the processes to handle the supply chain can be quite different. The question was therefore if it was possible to also mirror the supply chain processes. Taking the ideas from arrival overview and mirroring it to a shipment overview.

For receiving many reply on the Arrival overview to group together expected receipts and to create arrival journals. The Arrival overview is actually a quite good tool when you learn to use it. For the more the more advanced outbound logistics shipments are used to handle the picking, staging and loading of the goods. A customer came up the suggestion to create a “shipment overview”, but based on the arrival overview. This way the warehouse operator can search across shipments, but also have some volumetric indication of the load that is being released to the warehouse floor.

The arrival overview differs from other screens, because it actually consists of temporary tables that is build based on a query. The same thing happens here. The shipments are loaded on the upper grid, while the picking lines is loaded on the lower grid. There are advanced queries to control the loading of the data. Since it is a temporary table, the fields like address, weights, pallet quantity is real fields on the temporary table. This means that after the result have been fetched, the user can perform additional search and filtering. Like sorting and filtering the shipments in a based on addresses, pallet quantity, weight etc. Also the ability to multi select shipments or lines to be able to move lines between shipments. The screen will mainly be used for inquiry and for activating shipments.

And in relation to performance.. It is acceptable J

DAX2012 R3 – Playing with Retail CRT

The Microsoft Dynamics AX commerce runtime (CRT) serves as the engine for a retail channel. It connects to a CRT database that stores business data for the channel.. Dynamics AX uses the CRT Architecture in the Retail ePOS, mPOS and in the Sharepoint based eCommerce solution. Also the SiteCore eCommerce solution uses the CRT as the integration to Dynamics AX.

Let’s look at some of the interesting things with CRT.

1. It is a well-documented framework supported by Microsoft. More details on it is available here.

2. It can make it easier to integrate business logics to other eCommerce solutions. Like Magento.

3. We can create CRT web-services that handles information like very advanced retail prices, on-hand shipment, check-outs etc.

4. And MUCH more. This CRT we will have almost everything we need to interact with external system. It Rocks !

Let’s take an example. I would like to utilize the CRT to calculate a sales price with discounts. Price/discounts in AX is very flexible and almost all options you can imagine. Here is a small example of the possibilities we get in Dynamics AX 2012 R3 CU 8.

Let’s say we would like to expose this price/discount structure as a web-service to external parties. Since the CRT is relying on it’s own channel database, it means that the much of the integration is actually not creating a heavy load on the Dynamics AX database. We also have the possibility to “scale out” on the architecture.

The CRT is developed in Visual Studio, and is basically just a bunch of dll’s. I have to admit, that Visual studio, Web-services and is not my strongest side. So I decided to see it I could access and use the CRT framework directly from Dynamics AX. The new call-center module in AX 2012 R3 CU8 is using this, and I wanted to create a very simple job that exemplifies how CRT operates and can be used. Basically I’m looking for this:

I use the standard AX 2012 R3 CU8 contoso demo data, but added the following quantity discount to the Houston store;

Since I know X++, I’ll use X++ job to try this. The infolog I got was the following:

Here we see that the CRT returned the sales price, discounted price, and also information like total amount. Surely it can give everything else, but I wanted to keep the example easy to understand.

I created the following job to play with the framework, and it gives you an idea of how to interact with the CRT from AX.

static void demo_CRT_GetSalesPrice(Args _args)
{
    //To test this code, use the AX 2012 R3 CU8, and use the USRT company
    Microsoft.Dynamics.Commerce.Runtime.Data.IPricingDataManagerV2                pricingManager;
    Microsoft.Dynamics.Commerce.Runtime.Services.PricingEngine.DiscountParameters priceParameters;
    Microsoft.Dynamics.Commerce.Runtime.DataModel.SalesLine                       crtSalesLine;
    Microsoft.Dynamics.Commerce.Runtime.DataModel.SalesTransaction                crtSalesTransaction;
    System.Object                                                                 roundingRule, currencyConverter;
    CLRObject                                                                     clrSalesLines, enumeratorSalesLine;
    CLRObject                                                                     clrObjectSalesLines;
    System.DateTimeOffset                                                         activeDateTimeOffset;
    System.String                                                                 lineIdString;
    System.String                                                                 customerPriceGroup = "";
    Price                                                                         price;
    Qty                                                                           qty;
    InventDim                                                                     inventdim;

    RetailStoreTable    storeTable = RetailStoreTable::find("HOUSTON");   //Lets use houston as an example here
    RetailChannelRecId  channelId = storeTable.RecId;                     //This is the recid for a retail channel. A retail store is an extension of a retail channel.
    CurrencyCode        currencyCode = storeTable.Currency;
    appl.setDefaultCompany(storeTable.company(), false);                  //Setting default company to houstons company

    //Creating a unique line ID
    lineIdString = System.Guid::NewGuid().toString();

    InventDim.InventLocationId = storeTable.inventLocation;
    InventDim.InventSiteId     = InventLocation::find(storeTable.inventLocation).InventSiteId;
    InventDim                  = InventDim::findOrCreate(InventDim);

    //Pricing manager : Encapsulates data access to pricing information.
    pricingManager          = Microsoft.Dynamics.Commerce.Headquarters.RetailProxy.AxPricingDataManager::BuildDataManager(channelId);

    //Price parameters : types of AX discounts (aka trade agreement discounts, aka not Retail Periodic Discounts) are currently activated and should be allowed on the transaction
    priceParameters         = Microsoft.Dynamics.Commerce.Runtime.Services.PricingEngine.DiscountParameters::CreateAndInitialize(pricingManager);
    roundingRule            = Microsoft.Dynamics.Commerce.Headquarters.RetailProxy.ServiceHelpers::GetRoundingMethod(currencyCode);
    currencyConverter       = Microsoft.Dynamics.Commerce.Headquarters.RetailProxy.ServiceHelpers::GetCurrencyConverter(currencyCode);
    activeDateTimeOffset    = RetailPricingEngineHelper::getSessionDateTimeInChannelTimeZone(channelId);

    //Next we create a crtSalesLine, that represents a channel agnostic sales line.
    crtSalesLine = new Microsoft.Dynamics.Commerce.Runtime.DataModel.SalesLine();

    crtSalesLine.set_ItemId("0001");        //Lets use product 0001 as our example
    crtSalesLine.set_InventoryDimensionId(InventDim.inventDimId);
    crtSalesLine.set_Quantity(10);          //Lets use quantity 10 as our example
    crtSalesLine.set_LineId(lineIdString);  //Let give this line a uniqe ID

    crtSalesLine.set_UnitOfMeasureSymbol("ea"); //Let use 'ea' as the unit

    //We then create a sales transaction, and add the salesline to this.
    crtSalesTransaction = new Microsoft.Dynamics.Commerce.Runtime.DataModel.SalesTransaction();
    clrObjectSalesLines = crtSalesTransaction.get_SalesLines();
    clrObjectSalesLines.Add(crtSalesLine);                      //This is where the we add the salesLine to the sales transaction

    //Lets calculate the prices
    Microsoft.Dynamics.Commerce.Runtime.Services.PricingEngine.PricingEngine::CalculatePricesForTransaction(
        crtSalesTransaction,
        pricingManager,
        roundingRule,
        currencyConverter,
        customerPriceGroup,
        currencyCode,
        false,
        activeDateTimeOffset);

    //Lets calculate the discounts
    Microsoft.Dynamics.Commerce.Runtime.Services.PricingEngine.PricingEngine::CalculateDiscountsForLines(
        pricingManager,
        crtSalesTransaction,
        roundingRule,
        currencyConverter,
        currencyCode,
        '',
        '',
        '',
        true,
        Microsoft.Dynamics.Commerce.Runtime.DataModel.DiscountCalculationMode::CalculateAll,
        activeDateTimeOffset);

    //And, let's show what the CRT can give us.
    qty   = crtSalesLine.get_Quantity();
    Price = crtSalesLine.get_Price();
    info(strFmt("Normal sales price is %1 when buying %2", price, qty ));

    Price = crtSalesLine.get_DiscountAmount();
    info(strFmt("Discount amount pr unit is %1, when buying %2", price/qty, qty ));

    Price = crtSalesLine.get_NetAmountPerUnit();
    info(strFmt("Net amount pr unit is %1, when buying %2", price, qty ));

    Price = crtSalesLine.get_TotalAmount();

    info(strFmt("Total amount is %1 when buying %2", price, qty ));

Maybe some of you can teach me how to expose the CRT in a web-service, so that we can easily

 

 

 

DAX 2012 end-to-end processes and APQC

With LCS (Life cycle Services), Microsoft have taken steps to introduced the APQC (American Productivity & Quality Center) Process Classification Framework as one of the business modelers.

Microsoft have also created some flowcharts to visualize the APQC processes in dynamics AX.

In some Dynamics AX implementation projects it have been decided to use the APQC model, and the participants(including me) was struggling connecting the APQC model to actual tasks and activities performed in DAX. So I started on a small mental journey to better understand how to use APQC model, and to be able to connect the dots from the classification framework into dynamics AX swim lane process maps.

First I thought that is was possible to take some level 4 APQC try to draw them. It is possible to draw the small and simple activities, but I was struggling drawing an end-to-end processes. Like order-to-cash. I quickly realized that I cannot use the LCS-APQC model to explain end-to-end DAX processes, since end-to-end processes often will involve many different departments, functions and processes.

To visualize a complex processes in an end-to-end process like order-to-cash using APQC classification model I could imagine looking something like this.

Here we see the involved processes visualized with the APQC classification. And it makes sense. But it does not tell you how to use AX in in this process, because that is described using the level 4 (or 5) in APQC. Like in 8.2.2 Invoice customers, would be a specific process, that we can visualize in Dynamics AX/LCS.

The other thing I realized was that APQC is not about implementing a ERP system, like DAX, but it’s about improving the processes you have(regardless of what systems and applications you have). Some of the activities may be handled in DAX, but many is just how to improve the actual steps the company actually does. Very often it can be the working procedure, involving many systems and internal working processes. So you don’t ask “How does this APQC process look in DAX ?”. You should rather ask “What APQC processes is involved in the selected DAX processes (like order-to-pay).

The APQC model will therefore not tell you how to use and setup Dynamics AX. It will just help you to have a common language to classify your processes and to improve them. When it comes to visualizing Dynamics AX processes in swim lane flowcharts it can be a good idea to use the APQC identifiers as process identification.

My tip when using LCS, is to understand the APQC process identification model, and use it as a repository and building blocks when you create your own processes.

By referring to APQC on your own business model you can start on process improvement project for that specific process. You will can also evaluate to implement the benchmark indicators as APQC exemplifies.

My quick summary is therefore;

1. Do I like LCS, and will use it à Yes, and I will use it for implementation and DAX process visualizations.

2. Do I like APQC à Yes, and I will use it for classification, benchmarking and process improvements.

3. Do I think that the LCS APQC processes reflect what we see at customers à No

4. What would be nice to have in LCS business modeler à More end-to-end processes, where the APQC process identifiers is used would be nice.

Happy DAX’ing !!

 

Distribution orders in a cross company scenario.

Many retail enterprises have selected Dynamics AX as their main system to handle their processes for financials, procurement, logistics, merchandising and POS/retail. They have a presents globally and is true international enterprises. We also often see that they are organized through partnerships and francizing, and to be cost efficient a lot of processes like brand, assortment and logistics have been centralized.

Dynamics AX for Retail natively supports most scenarios by providing efficient processes for the retail industry. The flow of products by using intercompany trading simplifies transactions handling.

One question that arises is how clear boundaries between the legal entities should be ? What I would like to discuss in this blogpost is how to structure legal entities in Dynamics AX, and still be efficient. Let’s say we have the following 3 level structure of the enterprise.

Here we have a central enterprise legal entity, that have the responsibility of overall finance, reporting, products, recommended retail pricing, assortments and procurement.

The next tier is the regional logistics units. They can be own operated warehouses, or outsourced to third party logistics providers. The purpose is not only to serve stores and partners, but to perform logistics processes like receiving, quality control etc.

The tier at the bottom is where all the partners and stores are located. This can be based on a franchise model, partner or own stores. At least one legal entity per partner or country.

How to handle transactions between these entities?

Keeping a good track on processes and the transactions is vital. We need to know where costs occur, and how the transactions are handled. Here I would like to discuss a bit how the transactions can be handled. Let’s start with the partners and stores.

Products are purchased through a intercompany purchase order. If products needs to be internally moved, then transfer orders are used. When the stores sell products, then POS and sales orders are used. The transaction handling clean and easy with simple transactions. Some times there may be issues with costs that will arrive later, like transportation costs. This can be handled with misc. charges as described here.

In the figure above we see how inventory costs are originating from the vendor and the costs are propagated through the intercompany chain. Also how we can add additional charges like insurance, freight, and make sure that these costs flow through the intercompany chain.

The next tier, the regional logistics warehouses/distribution centers is also very simple. All goods are purchased from a vendor. This means that the vendor will have a matching sales invoice per regional logistics center.

All sales out of a regional logistics center is a intercompany sales order. If the center is a third party logistics provider, this means that the legal entity is mostly being handled by automated transactions and by integrations. What is important, is that it is an actual legal entity and is being handled as one. By doing this, it means that there are less need for customizations in handling financials and taxes.

Then we come to processes being handled in the headquarters; Enterprise processes and functions. This is the main topic of what I wanted to write about. The idea is to be able to control both the procurement/purchase and the distribution from a central perspective. It is fully possible to do this with standard AX, but it can be a bit resource intensive. I wanted to see if it was an easier way to deal with this, without making too many customizations. The concept is the “distribution order“.

Company wide distribution orders does not exists as a concept in standard AX. A distribution order is close to the “Buyer’s push” functionality that exists in Dynamics AX, but to be able to be handled in a global intercompany scenario. It means that you from a central perspective see and plan all the purchase orders and intercompany sales orders, regardless of whish legal entity that is performing the actual transactions.

The distribution order is not linked to a legal entity, but is created and controlled by HQ. The resources doing planning and procurement, and create a distribution, and add the lines/items they want to distribute. They can also add additional purchase order lines to the distribution. In the distribution lines the distribution quantity can be fetched directly from the purchase lines, or can be manually overridden.

It is also possible to “reverse” the creation process, where the planner starts with a set of manually created distribution lines, and then create the purchase orders created in each regional warehouse/legal entity.

It is also possible to create a distribution order of the type “On-hand” and “end-of-season”, that will base the quantity of the distribution lines on the available physical.

The planner can then run the process “create suggestion”, based on a distribution key. This will create a Distribution result. It will have one line per store. The planner can then choose to make manual changes. When the result is OK, then the planner can activate the distribution order. This will make the necessary intercompany sales orders from the regional logistics companies to the partner/stores.

Since the distribution order will have visibility across legal entities, the purchase lines and the intercompany sales orders can be additional linked through inventory marking. This can then enable the possibility for cross docking scenarios, and also to add the ability for direct delivery scenario’s.

We will then have the possibility to give the buyers and planes an overall view of all inbound and outbound logistics through all regional distribution centers. Also the ability to show current status and progress.

I have done this before in AX 2009 as you can read about here. And I would love to add this feature to the free Codeplex AX 2012 Global retail package. If this is interesting for you to have, please reach out to me, and we can have a discussion on an jointed cooperation.

Dynamics AX 2012: Warming up for presales demo

To really impress potential buyers of Dynamics AX, it is important that we are capable to show that AX 2012 responds fast. We normally use the Contoso hyper-v demo environment, and our laptops have limited resources. Starting a demo on a cold system, we often see that forms takes some time to operate in optimal performance. If you already have opened a form, it is much faster the second time you open it.

So how can we give the users a view of a fast system without manually opening all the forms prior to the demo?

We can warm them up J. I use the following job-script to open and close all the forms I’m planning to use. I just traverse through the AOT, and open the form, and then I close them again.

static void WarmupRF(Args _args)
{
    //This code is for "warming" up all RF* forms and code I have in the VAR-layer
    UtilElements e;
    TreeNode treeNode;
    FormRun formRun;
    Args args = new Args();

    while select e
        where e.utilLevel  == UtilEntryLevel::var    //<-- spesify layer here
        &&    e.recordType == UtilElementType::Form  //<-- and only forms
        &&    e.name like "RF*"                      //<-- I only want the forms that starts with the prefix RF*
        {
            try
            {
                treeNode = xUtilElements::getNodeInTree(xUtilElements::parentElement(e));
                args.name(treeNode.AOTname());
                formRun = ClassFactory.formRunClass(args);
                formRun.init();
                //formRun.run();   //<-- No need to run the form, but sometimes it can load the data
                formRun.close();
            }
            catch
            {
                Infolog.clear();
                continue;
            }
        }
}

The code must be modified to suit what you want to “warm-up”, but you get the idea.

This will make you demo go much more smooth, and you truly show the potential and performance of a warm Dynamics AX system.

Happy DAX’ing