Peripheral Simulator in new release of Dynamics 365 Operations

With one of the latest releases of Dynamics 365 Operations we have the option of simulating hardware peripherals like printers, cash drawers and so on.

The idea is to allow the user to simulate the flow of the retail processes including printers, drawers, scales, payments and so on but without having to occupy your co-workers desk piling up all of your retail hardware.

Here is what you need to do. Start by going to the hardware profiles. In the demo data a new profile has been added called Virtual. It has been set up with a profile that will work pretty much out of the box.

Besides the data a new button has been added allowing the download of the simulator:

hardware-profile-and-download-button

The simulator download hasn’t received the prettiest name, but that aside it is working great.

peripheralsimulator

The installer is very much a next-next-next installer and does not require any action taken unless you have specific wishes regarding installation folder.

Once installed you get this new application:

retail-peripheral-simulator

Already at this point we get an idea of what to expect. But before getting everything up and running you need to do a couple of more things.

First, we need to tell the store that the hardware station should use the new hardware profile:

hardware-profile-o

Run your 1070 and 1090 jobs (depending on which setup changes you made).

Now, starting up the POS you might end up with a series of hardware station errors that could look something like this:

hardware-station-error-3hardware-station-error-2comm-error-cash-drawer

To get passed this we should shortly touch upon how this works. According to the hardware profile we are using all communication is OPOS based so we need to get that onboard our POS machine as well. I used this one that previously was recommended during the installation of the POS software: Link to OPOS software

With that done you should be ready to start up your POS. You might have to manually go in and enable the use of the hardware station.

So first test could be a safe drop. In this case I pull out 10 USD:

make-safe-drop

That leaves a safe drop receipt in the printer:

safe-drop-receipt

And the drawer needs to be closed again:

cash-drawer-open

Click the Close drawer button to close it:

cash-drawer-closed

Let’s sell something. In this case a shirt:

transaction

I would like to pay this with a credit card so I switch to my simulator and select the MSR.

no-card-created

Click the + button to create new card:

create-master-card

The number is found on this page: credit card generator

Next step is to click the Pay card button in the POS followed by the Swipe card button in the Simulator. This adds the card info to the tender information in the POS:

card-details-in-pos

Completing the transaction you get a receipt in the printer:

receipt-from-transaction

This will definitely change the way we make demos of the POS with Dynamics 365 Operations.

 

Advertisements

No icon on buttons in LCS or AX7

In LCS or New Dynamics AX you might have noticed that you have buttons missing their icon/image. It looks like this:

The solution is really simple. Add the sites as trusted sites and you’re good.

Open Internet Options in your browser and go to the Security tab. Select Trusted sites and click Sites:

internetoptionssecurity

Add the current site to the list:

trustedsites

You’ll need both LCS and AX on the list to keep them both looking good.

Retail designer – Creating a database role with database access

Using the designer in AX 2012 for designing POS-buttons, receipts and whatever usually works for us eggheads with admin rights to the servers. But when it comes to the real users they might end up with an error like this:

ErrorMessage

What you need to do is to grant the users that need to work with the designer some additional rights directly to the Dynamics AX database. Scary stuff and something we’d rather not do; but in this case there’s no way around it. The good news is that it is only a few tables.

Here’s what to do:

Log on to the Microsoft SQL Server Management Studio, right click on the Dynamics AX database and select New Query.

NewQuery

Paste in this script and execute it. It will create a database role with the appropriate rights to the tables

  • RETAILBUTTONGRID
  • RETAILBUTTONGRIDBUTTONS
  • RETAILFORMLAYOUT
  • RETAILIMAGES
  • RETAILTERMINALCUSTOMFIELD
  • RETAILTILLLAYOUT
  • RETAILOPERATIONS

and select rights on these:

  • RETAILSALESTAXOVERRIDE
  • RETAILSTORETENDERTYPETABLE
  • RETAILSALESTAXOVERRIDEGROUPMEMBER
  • INVENTITEMBARCODE
  • INVENTTABLE
  • RETAILCHANNELTABLE
  • ECORESPRODUCTTRANSLATION

Notice, that the names of these tables may vary from AX version to AX version, but you’ll probably be able to locate the right tables.

The script:

CREATE ROLE [AX_POS_Designer]
GO

GRANT DELETE ON [dbo].[RETAILBUTTONGRID] TO [AX_POS_Designer]
GRANT INSERT ON [dbo].[RETAILBUTTONGRID] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILBUTTONGRID] TO [AX_POS_Designer]
GRANT UPDATE ON [dbo].[RETAILBUTTONGRID] TO [AX_POS_Designer]
GRANT DELETE ON [dbo].[RETAILBUTTONGRIDBUTTONS] TO [AX_POS_Designer]
GRANT INSERT ON [dbo].[RETAILBUTTONGRIDBUTTONS] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILBUTTONGRIDBUTTONS] TO [AX_POS_Designer]
GRANT UPDATE ON [dbo].[RETAILBUTTONGRIDBUTTONS] TO [AX_POS_Designer]
GRANT DELETE ON [dbo].[RETAILFORMLAYOUT] TO [AX_POS_Designer]
GRANT INSERT ON [dbo].[RETAILFORMLAYOUT] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILFORMLAYOUT] TO [AX_POS_Designer]
GRANT UPDATE ON [dbo].[RETAILFORMLAYOUT] TO [AX_POS_Designer]
GRANT DELETE ON [dbo].[RETAILTILLLAYOUT] TO [AX_POS_Designer]
GRANT INSERT ON [dbo].[RETAILTILLLAYOUT] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILTILLLAYOUT] TO [AX_POS_Designer]
GRANT UPDATE ON [dbo].[RETAILTILLLAYOUT] TO [AX_POS_Designer]
GRANT DELETE ON [dbo].[RETAILIMAGES] TO [AX_POS_Designer]
GRANT INSERT ON [dbo].[RETAILIMAGES] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILIMAGES] TO [AX_POS_Designer]
GRANT UPDATE ON [dbo].[RETAILIMAGES] TO [AX_POS_Designer]
GRANT DELETE ON [dbo].[RETAILTERMINALCUSTOMFIELD] TO [AX_POS_Designer]
GRANT INSERT ON [dbo].[RETAILTERMINALCUSTOMFIELD] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILTERMINALCUSTOMFIELD] TO [AX_POS_Designer]
GRANT UPDATE ON [dbo].[RETAILTERMINALCUSTOMFIELD] TO [AX_POS_Designer]
GRANT DELETE ON [dbo].[RETAILOPERATIONS] TO [AX_POS_Designer]
GRANT INSERT ON [dbo].[RETAILOPERATIONS] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILOPERATIONS] TO [AX_POS_Designer]
GRANT UPDATE ON [dbo].[RETAILOPERATIONS] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILSALESTAXOVERRIDE] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILSTORETENDERTYPETABLE] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILSALESTAXOVERRIDEGROUPMEMBER] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[INVENTITEMBARCODE] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[INVENTTABLE] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[RETAILCHANNELTABLE] TO [AX_POS_Designer]
GRANT SELECT ON [dbo].[ECORESPRODUCTTRANSLATION] TO [AX_POS_Designer]
GO

Now you’ve got the role. Next step is to create the required logins, map them to a database and the newly created role.

UserMapping

Log in to AX and check that the designer starts up successfully.

Associate worker with AAD account – Service unavailable

When trying to associate a worker with an AAD user in New Dynamics AX you can in some of the releases get an error saying “The service you are trying to reach is currently unavailable. Please contact your System Admin…”.

Workers_--_Error

Now in the New Dynamics AX the System Admin is often pretty hard to find unless you have a mirror so here is something that might get you passed that error. There’s no fancy stuff here. More a matter of how to approach the task.

Click “Associate existing account”:

Workers_--_StartAssociate

Change “Filter using columns” to “Search using email” and put in the email of the user:

Workers_--_SearchByEmail

 

Click Search and select the user on the list:

Workers_--_FindUser

Click OK and you’re back on the worker with a association to your user:

Workers_--_AssociationDone

 

The good part is that you can do this within a few seconds compared to having to wait for the full AAD to be loaded before you can pick the user, which you are going to be searching for anyways.

There is a hot fix released for this error, but if you just need to get it fixed now then the above work-around could help you out.

 

Lifecycle Services and Azure Resource Manager – First bump on the road…

We have been using Lifecycle Services (LCS) for hosting environments for both AX 2012 and AX7 (sorry, New Dynamics AX) so it was somewhat a trivial task deploying new servers. Until we met Azure Resource Manager, that is. Adding servers to an old project ended up giving us this error message:

Lifecycle Services can’t connect to the Azure subscription using Azure Resource Manager. Click the Microsoft Azure Settings button and edit the selected Connector to provide the required permissions to ERP applications in your Azure subscription.

Error_message

The fix is fairly simple. Go to the Azure connector in your project. You’ll find it in the Project settings. Select it and click Edit. What you need to do is to flip this one to Yes:

Project_Flip_This

It will then lead you through a couple of steps regarding your management certificate and how you need to download it and upload it to the Azure Portal. No need to worry about that because you already did that when you created the connector so just click Next.

You could then end up with another obstacle in the form of missing rights on the Azure tier:

Project_Need_To_Add_Role

Go to Azure Portal and go to your subscription. Click this button to do add access:

Azure_Add_Access_Add

The following is pretty straight forward. Select a role and select the user:

Azure_Add_Access

Azure_Add_Access_Select_User

Azure_Add_Access_User_Done

Going back into LCS and click Next might present you with the same error like above with the Dynamics Deployment Service needs access but hang in there. It seems like there’s a bit of delay, so just give it another go after a minute or two.

As soon as your connector has been updated you’re good to go and can deploy the server.

Debugging Commerce Runtime in the New Dynamics AX (AX7)

 

The New Dynamics AX has certainly shown us new ways of working and for the developer the learning curve has been pretty steep.

With everything being Visual Studio for the developers new work routines are implemented and that goes for debugging as well.

Now, the Visual Studio debugger is great. So we are not losing any ground. We do however have to think a bit different in order to nail those tricky troubleshooting situations. In this post I will show how to debug the Commerce Runtime part of the Retail Server.

 

Step 1 – Getting the IIS ready

Navigate to the Retail Server folder. One way to get there is to open the IIS Manager. Locate and select the RetailServer in the Sites list to the left and select Explore. In the web.config file change

<compilation debug="false" targetFramework="4.5" />

to

<compilation debug="true" targetFramework="4.5" />

When you save the file you cannot save it to its original position. Save it to your desktop or somewhere else neutral and then copy it to the original folder.

Restart the IIS

 

Step 2 – Set the breakpoint

Now start up Visual Studio and open the solution CommerceRuntime in the RetailSDK folder \RetailSDK\Code\CommerceRuntime.

In the solution explorer locate the Discount.cs file in Runtime.PricingEngine project and add a breakpoint. Just to keep it simple I have put it into the constructor:Breakpoint Discount constructor

 

Step 3 – Start the Modern POS

Now it is time to fire up the Modern POS. Just do a login and leave it there for a while.

 

Step 4 – Get the debugger ready

Go back to Visual Studio, go to the Debug menu and select Attach to process.

Change the code type from automatic to Managed (v4.6, v4.5, v4.0)

AX7POSDebugCodeType

Mark Show processes from all users, select the w3wp.exe processes and click Attach.

AX7POSDebugProcess

I know that you probably only need to attach to one of them; but it is much easier just selecting them all.

Take a quick look at your breakpoints to make sure that they are active. If not you might be missing a reference in the commerceruntime file.

Breakpoint active Discount constructor

Step 5 – Back to the POS to get the debugger activated

What we need to do now is to get the POS to require an instance of the Discount object on the retail server. In this example I add a pair of sunglasses to the basket:

Add product to get the Discount object instantiated

That gets us into the debugger and we can do what we need to do in order to see how it works or start troubleshoot.

Debugger activated

I hope this helps you get a bit deeper into the retail server or other services related to the New Dynamics AX.

 

 

 

Test access to Retail server on The New Dynamics AX

Just a quick heads-up on a feature allowing you to test the access to the Retail server in The New Dynamics AX.

From a browser open the site:

https://<my server name>ret.cloudax.dynamics.com/healthcheck?testname=ping

It shows you a ping test result looking like this:

RetailServerTest

If you need the results in a more developer-friendly format you can add a &resultFormat=xml which gives you something like this:

RetailServerTestXML