A blog on Dynamics 365 for Operations – Retail

Category: Dynamics 365 for Operations – Retail (Page 2 of 2)

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

Retail SDK Handbook

Note – This is a republish of my earlier article and is based on 7.1.

As of 7.3 the Handbook has been replaced with below link –

https://docs.microsoft.com/en-us/dynamics365/unified-operations/retail/dev-itpro/dev-retail-home-page

Just a short but nevertheless important post. I discovered this document AX7 Retail Handbook while browsing my LCS deployed AX 7 RTW VM’s Retail SDK folder.

Overall the document is made up of two parts.

The first covers the Retail Sdk, build, configurations that can be done to be more productive. Additionally, typical branching strategy is discussed in order to work effectively in teams.

The second part contains details about the main extensibilities that are possible with the Retail Sdk. Anyone getting started with writing code based on the Sdk can use it as a reference in order to get started.

Some sample extensions are also provided in the same folder path.

Kudos to the team at Microsoft for going the extra mile to provide this document and sample extensions.

PS: If you have access to the LCS Deployed VM please access these materials there, else reach out to me using the contact page of this site and I can share a copy.

Update – These documents have been discussed in the Tech Conference Video ->Retail customizations: Part 1 which have been uploaded in the last week. Use below link to access  https://mbs.microsoft.com/customersource/northamerica/AX/learning/presentations/DynamicsTechnicalConference16

 

This post was first published at TechTalk

 

Writing a Test Job in AX7, Use of Like Operator and Bulk Update of Retail Screen Layout Button Properties

The following post will touch base on-

1. How we can execute a test job in AX7 which most of us already know in the good old AX 2012 as an AOT Node.

2. Use of ‘like’ operator-  AX uses asterik ‘*’ character instead of ‘%’ which we use in SQL.

3. Changing Layouts of Retail Screens need not be tedious and time consuming by changing properties of each button manually.

A job in AX7 is simply a public class and it must have a main method that provides the runnable code. The main method was required in AX 2012 too but there was no need for the class to have access specifier as public.  Another difference is that the Jobs Node in AOT is deprecated.
So how do we write a test job in AX7? you can start by referring to this link for steps to create one
Consider that you want to bulk update the properties of buttons in the Retail Screen Layouts. The below piece of code can help to do the bulk update in a matter of few minutes,  <Update> please note this method of bulk update is ideal in some scenarios like preparation of demos  where you want to try out different values of colors for the buttons for example. However usual  approach for bulk update is DIXF https://docs.microsoft.com/nb-no/dynamics365/unified-operations/dev-itpro/lifecycle-services/ax-2012/migrate-data-dixf</Update>
Note the use of like Operator (*) in this code.

 

class TestJob

{

    public static void Main(Args args)

    {

        RetailButtonGridButtons retailButtonGridButtons;

        update_recordset retailButtonGridButtons

            setting BackColor=-65536,

                    BackColor2=-65536,

                    FontColor=0

        where retailButtonGridButtons.buttonGridId like ‘*ABC*’;

    }

}

On running the above code we get following screen on successful completion

 So with this code you dont need to go to each Button Grid in the layout and change properties manually. So you can save your time and skip having to see the following screen multiple times

 Note – This post was first published in TechTalk

-Hitesh Manglani

Dynamics 365 for Operations and TLS 1.2

In my first Dynamics 365 for Operations project we had to implement an integration between the Azure hosted Dynamics 365 for Operations Retail Server and an on premise web api server (for more information on the overall Retail Topology do refer this link MPOS Technical Architecture).

The integration worked fine in our Development environment but when promoted to UAT sandbox the integration broke with the following error

Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

and initially we could not understand why, after some investigation we could find out the cause being that Dynamics 365 for Operations configuration enforced a TLS 1.2 protocol while the destination server supported only TLS 1.0 and 1.1.

The following resources were very helpful to arrive at the conclusion

https://docs.microsoft.com/en-us/dynamics365/unified-operations/retail/retail-peripherals-overview

https://blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/

Last but not the least, an excellent resource was the following link by John Louros.

https://www.johnlouros.com/blog/disabling-cryptographic-protocols-for-pci-compliance

In this blog, John has provided a nifty console application which was extremely helpful in understanding what was going wrong in the integration, by trying all combinations of TLS protocols between the source and destination it lets you know which protocol is supported and which one is not.

 

-Hitesh Manglani

 

 

The service is not provisioned for the same tenant

If you have downloaded an Dynamics 365 for Operations / AX7 VM for Development especially for Retail do have a look at this article

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/dev-tools/access-instances

Unless you do the steps mentioned in the Retail Configuration section in this link you will get errors like :

In MPOS trying to activate would give an error – The service is not provisioned for the same tenant. User is hitting a retail server that does not belong to the same tenant as the Activation account.

Also if you try to Associate User Identity with a worker in AX it will result in an error like the service is not reachable.

Note – You need to install KB3170424 if you are facing this issue in a LCS hosted VM.

 

-Hitesh Manglani

Problem uninstalling MPOS or any other application

Sometimes I have experienced an error when trying to uninstall MPOS or any other program for that matter.

MPOS uninstall

Corrupted registry keys are one of the reasons for such an error.

The following utility from Microsoft helps to cleanly uninstall MPOS  or any other program not uninstalling in such a situation.

https://support.microsoft.com/en-gb/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed

In addition you may also needed to follow these steps to make sure all MPOS packages are removed (especially when multiple user profiles are setup)

  1. Run the following powershell script as Admin user. (Note that you can run the Powershell command by loading it the command prompt by executing powershell command as shown below)

Get-AppxPackage *pos* – allusers

Uninstall

2.  Note the PackageUserInformation in the above results. It will list the users for which the package has been provisioned. The package can then be removed using the following script.

Get-AppxPackage *pos*  | Remove-AppxPackage

Note – You will need to execute the above command for each user by logging in as that particular user in command prompt. For instance lets consider that there are two users admin and user1. You will need to execute the powershell twice, once as admin and once as user1, by using “Run as a different user” option by right clicking the command prompt icon

Run as a different user menu

Hope this helps

-Hitesh Manglani

[AX 2012 R3 / Dynamics 365 for Operations -Retail]: Viewing events from MPOS in Event Viewer

This post is based on a conversation in Dynamics AX Community (link attached later in the post)

 

Events from the MPOS in AX 2012 R3 can be found in Event Viewer here:

Application and Services Logs -> Microsoft -> Windows -> AppHost -> AppTracing.

activate the event log using Event Viewer.

  1. Navigate to Application and Services Logs -> Microsoft -> Windows -> AppHost.
  2. Right click AppHost and Select View -> Show Analytic and Debug Logs

Events from the MPOS in AX 7 / Dynamics 365 for Operations can be found in Event Viewer here:

Event Viewer: Applications and Services Logs->Microsoft->Dynamics->Commerce-ModernPos.- Admin, Debug, Operational (where Operational would contain errors and Debug is by default disabled but can be Enabled if needed.)

 

Please visit the source of this post at this link

for more information.

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

Newer posts »

© 2023 Dynamics Journal

Theme by Anders NorenUp ↑