A blog on Dynamics 365 for Operations – Retail

Category: Dynamics 365 for Operations v7 Update 1

PostEndTransactionTrigger – The trigger that may not trigger.

So here is an interesting tidbit from a recent incident in which I was supporting the customer on Dynamics 365 for Operations – Retail.

Few transactions were suddenly reported as “Missing”  by the customer. The customer provided transaction details including CCTV grab along with Credit Card Slip. I started my investigation the server logs and found that the transaction id seemed be used across two transactions. This meant that the cart was not got getting cleared. In my customization I needed to access the cart information post the cart checkout and my cart clearing code was written in the PostEndTransactionTrigger.

We also logged a support ticket with MS and over time understood from MS that the MPOS is being exited by the cashier without closing the Change Due Dialog, which resulted in the PostEndTransactionTrigger not executing.

Long story short, if you are using this Trigger, make sure it contains non -critical code as it may not trigger if user exits MPOS without closing the above change due dialog. 

This article is based on 7.1 Retail SDK but should be applicable to later releases too unless a fix for this has been released.

Hope this helps

-Hitesh Manglani

 

 

 

MPOS AAD changes – The reply address does not match the reply addresses configured for the application

If you are on Dynamics 365 for Operations 7.1 and planning to uptake the latest set of binary hotfixes, expect to see the above error when trying to activate MPOS.

Sergey from Microsoft has described the change that is triggered by binary hotfix KB4051347 in below link in great detail. Just one note though if you are on 7.1 you will not find the event ID 40619 in the event viewer. Its only available 7.2 onwards.

https://community.dynamics.com/ax/b/axforretail/archive/2017/11/06/mpos-aad-changes-in-monthly-update-4

In case you are interested to know more about these changes the below link is a great video that describes the differences between ADAL versus MSAL –https://channel9.msdn.com/Events/Build/2017/P4031

-Hitesh Manglani

A simple customization in MPOS (Blank Operation) with Dynamics 365 for Operations

Note – This article is applicable upto Dynamics 365 for Operations- 7.1 i.e. not applicable to 7.2 and above

Hi All,

 

Blank Operation as you may already be aware enable you to extend Microsoft Dynamics Retail for POS by adding custom logic that can be triggered from the Retail POS Register buttons. The way to implement Blank Operations in MPOS  is different from Enterprise POS as MPOS is a modern app as compared to EPOS which is a windows forms based app.

So lets explore a very simple customization i.e. we want to open a URL on triggering a button from MPOS.

1. We would need to start with AX to add a button to the layout of MPOS. If you do not want to disturb the standard layouts its better to copy one of the existing layouts and then modify it using the designer. Please note the designer only opens in Internet Explorer so it will save you time by not trying to open it in other browsers e.g Chrome

<Update > If you can trust third party extension, you can install ClickOnce  for Google Chrome extension to be able to open the designer in Chrome</Update>

2. Next we need to add this layout to the Store where we intend to use it, in my case I have choosen Houston Store

3. We need to modify the screen layout in the worker setup.

Next run jobs 1060,1070, 1090 to push the worker,store configuration and the new screen layout respectively to Channel DB.

Lets run MPOS SDK code from Visual Studio and check if the changes are reflected.

As you can see we have a new button in MPOS which can be used to invoke custom logic. Currently on triggering the button gives us a message “The blank operation identifier is invalid”

Now make the following modifications in the code.

In POS.ViewModels->OperationsMap.ts add the following line of code to register a new handler for the custom blank operation

Operations.BlankOperationHandler.registerBlankOperationHandler(“CustomOpenURL”, new Operations.OpenURLOperationHandler());

Next we need to provide the definition for the handler, to do this headover to Pos.Core->Operations->Add a new typescript file say CustomBlankOperations.ts and paste following code.

module Commerce.Operations {

“use strict”;

export class OpenURLOperationHandler extends OperationHandlerBase {

/**

* Executes the OpenURL operation.

*

* @param { IBlankOperationOptions } options The operation options.

* @return {IAsyncResultIOperationResult>} The async result containing the operation result, if any.

*/

public execute(options: IBlankOperationOptions): IAsyncResultIOperationResult> {

// sanitize options

options = options || { operationId: undefined, operationData: undefined };

var asyncQueue: AsyncQueue = new AsyncQueue();

var asyncResult: VoidAsyncResult = new VoidAsyncResult(null);

var url = String(options);

asyncQueue.enqueue((): IAsyncResultICancelableResult> => {

Windows.System.Launcher.launchUriAsync(

new Windows.Foundation.Uri(url)

);

return asyncResult;

});

return asyncQueue.run();

}

}

}

On running the modified app you should be able to successfully run the blank operation and see the web page in this case http://www.bing.com opened in your browser.

So hopefully this exercise will whet your appetite and for a deeper dive to more MPOS customizations I would suggest the following resources to try out in AX 7-

1. http://blogs.msdn.com/b/axsa/archive/2015/02/17/extensibility-in-dynamics-ax-2012-r3-cu8-crt-retailserver-mpos-part-1.aspx

2. http://blogs.msdn.com/b/axsa/archive/2015/05/20/extensibility-in-dynamics-ax-2012-r3-cu8-crt-retailserver-mpos-part-2-new-data-entity.aspx

 

hope this helps

-Hitesh Manglani

This post was first published at http://hiteshgoldeneye-techtalk.blogspot.sg/2015/12/a-simple-customization-in-mpos-blank.html

© 2023 Dynamics Journal

Theme by Anders NorenUp ↑