Monday, March 20, 2017

mPOS Offline Provision



I'm sure we all get frustrated when creating an offline database for mPOS only to find out that it wasn't able to provisioned, and the process drop your newly created offline database completely. ¯\_(ツ)_/¯ this is the look I generally make when that happens. Then I asked myself what went wrong and go back to the drawing board to trace the error. Luckily Brian Storie from Microsoft have given a breakdown of the steps we need to take in order to create AND provision our offline database correctly. All credits are given to Brian Storie. The steps sometimes works, but it's definitely a good place to start.


Open Windows File Exporer
1. Go to: C:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Database Utility
2. Click File > Open Command Prompt > Command Prompt with Admin
    Enter the following command (Please change the highlighted values to the name of the SQL  
    Server hosting your channel DB, and the name of your Channel DB)

RetailDbUtilityCmd.exe DeprovisionChannelDB /StoreServerName:YOURSERVERNAME /StoreDatabaseName:YOURCHANNELDATABASE

3. After this command completes, open SQL Server Management Studio, connect to the Channel DB.
4. Expand Tables under the Channel DB
5. Verify any table that ends with _tracking are all deleted in YOURCHANNELDATABASE. (if one does exist then manually delete it)
6. Verify the following three tables do not exist (dbo.schema_info dbo.Scope_config dbo.Scope_info) if they do manually delete them
7. Open “Retail Channel Configuration Utility” as an admin. Go to “Create offline database” section. Enter correct channel database and offline database information. Then click “Apply”.



If all goes well you should be able to create and provision your offline database successfully. hopefully this should help those who are having provisioning problem when creating a new offline database. If you want to know more details on the error, the log file is located in

C:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Database Utility\RetailDatabaseUtility.log

Thursday, March 9, 2017

"You can't switch to offline mode. Either the offline components are not installed or the logon failed"

I'm back once again with a new issue and possibly a solution on how to fix this problem.
I'm assuming at this point you had offline database installed and you wanted to test whether the offline mode is working or not. You've added "Database connection status" button and this allows you to switch to offline mode. When you tried to hit "Disconnect" you get an error "You can't switch to offline mode. Either the offline components are not installed or the logon failed" okay here are the steps I generally take and seems to works most of the times (I can't guaranteed it will work for you, but it's a good place to start debugging the issue).



Step 1: If you have offline sync service running. Go ahead and stop the service. If the service get stuck in "Stopping" status then you need to execute this command line using command prompt as admin.
Type in:
 sc queryex DynamicsRetailModernPOSOfflineSyncService

what you need to look for is the PID. Once you have locate the PID you want to go ahead and type this command line.
taskkill /f /pid (PID) <---put in your PID, ignore the parentheses. 
So for example if my PID is 12345 then I would type in. taskkill /f /pid 12345.
After you have done that go back into services and refresh to make sure the offline sync service status is blank.



Step 2: Go to Retail Channel Configuration Utility, select Configure Retail Modern POS and fill in the correct information in here.

To make sure you're using the correct DB hit the "Test connection" and it will let you know if you are connected successfully or not. I also "Configure POS User permissions". Once everything is done click "Apply" and you should get a message box saying that it was successful.



























Step 3: Go to Services and hit refresh and make sure the offline sync service status is set to "Running".



Step 4: Go into AX and run the 1070 job and make sure it applied.


Step 5: Log into mPOS and attempt to go offline by clicking "Disconnect". If everything is done correctly you should be able to go offline without getting any error saying you don't have offline component installed.


Step 6: Go grab a beer from the fridge cause you deserve it! ¯\_(ツ)_/¯