A blog on Dynamics 365 for Operations – Retail

Tag: MPOS (Page 1 of 2)

Dynamics 365 for Retail Upgrade – Backward compatibility

Been a while since I last posted as I was busy with upgrading our implementation from v7.1 to v10. During our upgrade from Dynamics 365 for Retail v7.1 to v10.0, one of the main issue we faced is that of Backward compatibility.

The issue occurs when trying to run v7.1 MPOS with v10.0 Retail Server, basically “Declare Start Amount”feature does not work.

On trying to declare the start amount the cashier gets the following prompt.

IMG_3420

On trying to key in any value, the start amount results as NAN.

IMG_3421

Reattempting to declare the start amount simply repeats the above prompts. Now this issue is serious since it prevents the closing of shift as shown in the screenshot below.

IMG_3422

My investigation started with debugging the MPOS code and eventually the CRT code, and I found that one of the fields “StartingAmount” had been removed from crt.ShiftsView. This was causing its value to stay as undefined.

The good news is that issue is reported to Microsoft, and we are currently awaiting the fix (currently expected in v10.0.4)

-Hitesh Manglani

 

 

 

 

MPOS Build Error – App manifest validation error: The app manifest must be valid as per schema

When trying to build the MPOS solution on my laptop, I got the below error.

getimage

Error APPX0501 Validation error. error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 10, Column 50, Reason: —————‘ violates pattern constraint of ‘(CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|Description|PostalCode|POBox|Phone|X21Address|dnQualifier|(OID\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))+))=(([^,+=”<>#;])+|”.*”)(, ((CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|Description|PostalCode|POBox|Phone|X21Address|dnQualifier|(OID\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))+))=(([^,+=”<>#;])+|”.*”)))*’. The attribute ‘Publisher’ with value ————- failed to parse. Pos.App ” 1

App manifest validation error: The app manifest must be valid as per schema: Line 10, Column SO, Reason: ‘xxxx’ violates pattern constraint of ‘(CNILIOIOUIEICISISTREETITIGIIISNIDCI
((CNILIOIOUIEICISISTREETITIGIIISNIDCISERIALNUM8ERIDescriptionPostalCodeP080xI
PhoneIX21 . The attribute ‘Publisher’ with value ‘xxx’ failed to parse.

It took me a while to figure it out but this was happening because certain features in Visual Studio were not installed, the Retail SDK Handbook helped me to confirm which features were needed to be installed. After installing the highlighted features, I restarted the machine and the solution built successfully.

visualstudiofeatures

 

Hope this helps, if someone meets the same error.

-Hitesh Manglani

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

 

 

 

Custom error messages in MPOS

This post is for describing how we can show custom error messages in MPOS.

MPOS standard error handlers require that the strings to be shown as error messages are entered in the following format within the resources.json file (en-US).

“string_55001” : “This is a custom error.”,

Within MPOS we could use the following snippet to display any custom error messages

let displayMessageActivity: Commerce.Activities.DisplayMessageActivity = new Commerce.Activities.DisplayMessageActivity({
title: ‘Custom Error’,
message: Commerce.ViewModelAdapter.getResourceString(“string_55001“)
});
displayMessageActivity.execute().done(() => {
// code to run on successful display of the error dialog
}).fail(() => {
// code to run on failure in displaying the error dialog
});

If however the error condition is met in the Commerce Run Time (CRT) you need to show the error message in MPOS, you can leverage the CommerceRunTimeException

throw new CommerceException(“string_55047”, “CUSTOM ERROR MESSAGE”);

 

One possibility is that the error messages could be coming from a third party application. On a recent integration I received a list of predefined error codes with error messages from the application.I then defined an enum in the CRT which had the values as this status codes and names as the error messages

e.g.

INVALID_OPTION = 152

ERROR_NEW_PASSWORD_CANNOT_BE_THE_SAME_AS_OLD_PASSWORD = 180

I defined a corresponding Enum in the CRT

public enum AppError
{

INVALID_OPTION = 152

ERROR_NEW_PASSWORD_CANNOT_BE_THE_SAME_AS_OLD_PASSWORD = 180

}

After deserializing the response I checked the ReturnStatus code from the application and used an offset (50050) to throw the correct error message from the resources.json file

if (Enum.IsDefined(typeof(AppError), res.ReturnStatus))
{
AppError err = (AppError)res.ReturnStatus;
throw new CommerceException(“string_” + (50050 + res.ReturnStatus) , err.ToString().Replace(“_”, ” “));
}

<Update>

I later discovered a simpler way by following the Retail SDK example

throw new CommerceException(“Microsoft_Dynamics_Commerce_30104”, “Custom error”)
{
LocalizedMessage = “Custom error message returned by the third party app”;

};

</Update>

Hope this helps

-Hitesh Manglani

 

 

 

 

 

 

 

 

MPOS, Retail Server – JSON API Integration

Recently I had to work on developing an integration between MPOS and a CRM application via Retail Server/CRT. The REST APIs provided where JSON based and I needed C# classes to deserialize the response.

My gut feel said that there should be a tool to do this and I need not create the required classes and properties manually.

Sure enough after some web search, I found https://jsonutils.com/

This is an awesome site where you can provide a sample JSON API response and get the C# classes that can be used to deserialize the JSON.

Hope this helps  you save some time, just as it helped me.

-Hitesh Manglani

MPOS touch screen grid freeze issue

Note – This issue occurs only on few POS models so you may or may not face this issue. I do not have a list of models that have this issue, though I have experienced this on a HP RP9 POS and on D365FO 7.1 Retail SDK

When trying to scroll through MPOS using touch gesture, in the views that have a grid (examples Tender Declaration, Show Journal, Product Search) you may experience the screen layout on the row you touch, getting out of alignment with the remaining rows and the screen freezes with no further response to touch gestures.

A workaround is to use a mouse instead of touch for scrolling but obviously this can only be a temporary arrangement.

When we contacted Microsoft support, we were given a one line code change fix  that consists in changing the WinJS script that is provided  in the Retail SDK. The script to be changed is the WinJS ui.js and update the equivalent minified file (ui.min.js). The exact change can be seen in this github link: https://github.com/winjs/winjs/commit/a48a12e33e08fccdea7879af877b2cc3a7cb8ec3

 

-Hitesh Manglani

 

MPOS Package failed to deploy – Windows cannot install package because this package depends on a framework that could not be found

So recently I successfully build my Retail SDK and uploaded the installer to one of my D365FO environment, but when trying to install the package faced the below issue.

“Windows cannot install package because this package depends on a framework that could not be found”

Here is an extract of the MPOS installation error logs.

System.IO.IOException: Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict validation.

Windows cannot install package xxx because this package depends on a framework that could not be found. Provide the framework “Microsoft.NET.CoreRuntime.1.0” published by “CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US”, with neutral or x64 processor architecture and minimum version 1.0.23819.0, along with this package to install

 

<Final Update 18 Apr 2018>

The solution is to build the package with configuration=release,

msbuild /p:Configuration=Release

thanks to MVP Kurt Hatlevik  

</Final Update>

 

-Hitesh Manglani

MPOS randomly switching from online mode to offline

In my recent Dynamics 365 for Operations implementation on 7.1, we encountered an issue with MPOS switching to offline randomly . MPOS as we know switches to offline either when triggered manually or when the switch is seamless (automatically) when there is any issue in the communication between MPOS and D365 Retail Server, an example is a network interruption (for more information on the overall Retail Topology do refer this link MPOS Technical Architecture)

In a usual scenario, when an interruption occurs in between a transaction, cashier would get an error message the Cart State has changed. The cashier would need to void the transaction and then start all over again and end with creating an offline transaction (Not the kind of experience you want when you have a queue of customers at the billing).  Another issue that coupled with this was that the MPOS logo would not switch from offline to online when the MPOS mode switched.

 

Bottomline –

Make sure you uptake following binary hotfixes as soon as you can if you have enabled MPOS in offline mode

KB 4049328 – MPOS offline logo issue

KB 4058723- Set of reliability fixes for POS Offline

Also include the following X++ hotfix which complements the above binary fix

KB4058724 – Set of reliability fixes for POS Offline

 

 

-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.

« Older posts

© 2023 Dynamics Journal

Theme by Anders NorenUp ↑