Friday, 17 March 2017

Troubleshoot connectivity problems for Retail Modern POS devices [AX 2012]


This topic explains how to troubleshoot and fix errors that occur when activating a modern point of sale (MPOS) device. To perform these tasks, a user must have access to Headquarters, must have IT Administrator rights on the computers that are running the Retail Server, Real-time Services, and the channel database, and must be assigned to a POS permission group that has device activation rights.
Permissions for a user can be modified after they have been assigned to a POS permission group in the Worker > Retail > POS Permissions form. 
Caution noteCaution
In Retail essentials, the forms that you use to complete some tasks might include only a subset of the controls that are available for other configurations of Retail. If a topic about these forms describes controls that you don't see, it may be because you’re using Retail essentials.
MPOS cannot be used with Retail essentials.

Terminal not assigned to store

  1. Go to Retail > Setup > POS > POS registers.
  2. Select the register that you are trying to activate the device for, and then on the Register tab, click Edit.
  3. Check the Store number value. If it is empty or contains the wrong store number, enter the correct value.
  4. Click Close to save your changes.
  5. Go to Retail > Periodic > Data distribution > Distribution schedule.
  6. Run job 1090 (Registers) and wait for it to finish.
  7. Activate the device again using the correct information.
  8. The device should now activate successfully.

Worker not assigned to store

  1. Go to Retail > Common > Workers.
  2. Select the worker (Operator ID) that you are trying to activate the device for and then on the Worker tab, click Edit.
  3. Check the Address Book value under Other information. If it is empty or contains the wrong address book, enter the correct value.
  4. Click Close to save your changes.
  5. Go to Retail > Common > Retail channels > Retail stores.
  6. Select the store that you are trying to activate the device for, and then on the Store tab, click Edit.
  7. Under Address book > Employee address book verify that the address book is the one the worker belongs to. If it is the wrong address book, either change to the correct address book, or assign the employee to the correct address book.
  8. Click Close to save your changes.
  9. Go to Retail > Periodic > Data distribution > Distribution schedule.
  10. Run jobs 1060 (Staff) and 1070 (Channel Configuration) and wait for them to finish.
  11. Activate the device again using the correct information.
  12. The device should now activate successfully.

Incorrect staff ID or password

  1. Go to Retail > Common > Workers.
  2. Select the worker (Operator ID) that you are trying to activate the device for and then on the Worker tab, click Edit.
  3. In the left pane, click Profile, and then check the personnel number. This should be same as the Operator ID you are trying to use for activation.
  4. In the left pane, click Retail, and then change the password.
  5. Go to Retail > Periodic > Data distribution > Distribution schedule.
  6. Run job 1060 (Staff) and wait for it to finish.
  7. Activate the device again using the correct operator ID and updated password.
  8. The device should now activate successfully.

Device already activated

  1. Click Retail > Setup > Devices.
  2. Select the number of the device that you are trying to activate.
  3. In the Activation status column, check whether the status is activated or deactivated.
  4. Change the Activation status to Pending.
  5. Activate the device again.
  6. The device should now activate successfully.

Channel database connection failed

To perform the following procedure, you must be an administrator on the Retail server computer and the Channel database computer.
In the headquarters environment, perform the following steps:
  1. Go to Retail > Setup > Retail scheduler > Channel integration > Channel database.
  2. Select the channel database ID that you are trying to connect to.
  3. On the Retail channel FastTab, validate that the server name and database name are accurate.
Log in to the computer that hosts the Retail server.
  1. Check whether the Retail server is configured to match the correct channel database.
  2. Check whether the channel database ID matches the connection string of the database that you are accessing for the store where the Modern POS will be used.
If you had to modify the channel database connection string (channel database ID), you must run the Channel configuration job and reset IIS.
  1. In the channel database form (Retail > Setup > Retail Scheduler > Channel integration > Channel database), run the Channel Configuration job (1070).
  2. On the Retail server, perform an App Pool Refresh or iisreset.
  3. Activate the device again using the correct information.
  4. The device should now activate successfully.

Real-time Service connection failed

You must be a local administrator on the computers that host the Real-time Service and the Retail Server to perform these steps.
  1. Go to Retail > Setup > Parameters > Retail shared parameters.
  2. In the left pane, select General.
  3. Under the Devices section, make sure that Real-time Service profile for device activation is selected for the correct Real-time Service profile.
  4. Go to Retail > Setup > Retail scheduler > Channel integration > Real-time Service profiles.
  5. Check whether the server name is correct, and whether the common name is the subject name of your certificate.
Log in to the computer that hosts the Real-time Service.
  1. Open IIS and check whether the Real-time Service is running.
  2. Refresh the App pool or perform an iisreset.
Log in to the computer that hosts the Retail Server.
  1. If you had to change the Real-time Service URL, refresh the app pool or perform an iisreset for the Retail Server.
  2. Activate the device again using the correct information.
  3. The device should now activate successfully.

Server not responding

You must be a local administrator on the computers that host the AOS, Real-time Service, and Retail Server to perform this procedure.
  1. Validate that the AOS windows service, Real-time Service (Web service), and Retail Server (Web service) are running.
  2. Log in to the computer that hosts the Retail Server.
  3. Check that the Retail Server is configured to use the correct URL and port. This should be the same URL that you use to activate from the Modern POS device.
  4. Refresh the app pool or perform an iisreset for the Retail Server.
  5. Activate the device again using the correct information.
  6. The device should now activate successfully.

Modern POS Activation in Dynamics AX for Retail R3

Hi Guys, With the latest version Microsoft Dynamics AX 2012, Microsoft has came out with the Mobile application for Retail POS which includes Retail Modern POS, a point-of-sale app for PCs, tablets, and phones. The modern POS includes the basics around tender/transaction, but now also extends into a rich clienteling or assisted sales offering, as well as back office capabilities at the employees fingertips. The power of this new modern POS is that it becomes much more than a Point of Sale experience – it is a customer engagement dashboard! I would like to give you a brief walk-through on the installation and activation process of Modern POS. Follow below steps to install and activate Modern POS in Windows Server 2012 R2 or Windows 8.
Install Desktop Experience
Install Desktop Experience in Windows server 2012 R2
  1. Click Start, point to Administrative Tools, and then click Server Manager.
  1. In Server Manager, click Features, and then in the Server Manager Details pane, under Features Summary, click Add features.
  1. The Adding Features Wizard starts.
  1. In the Features list, select Desktop Experience, and then click Install.
Developer license
Getting a developer license at a command prompt
  • Show-WindowsDeveloperLicenseRegistration. This command opens a dialog box from which you can get a developer license and install it on the local machine. To run this command, you must have a valid Microsoft account. You also must run this command in a command prompt with elevated permissions.
  • Get-WindowsDeveloperLicense. This command returns an object that has two properties: ExpirationTime and IsValid. ExpirationTime is a System.DateTime structure that contains the date and time when the license expires. IsValid is a System.Boolean that indicates whether the license is valid. You can run this command from a command prompt that doesn’t have elevated permissions.
  • Unregister-WindowsDeveloperLicense. This command warns you that some apps will stop working if you remove the developer license from the local machine. If you choose “Yes” (the default) to confirm that you want to remove the license, the license is removed from the local machine. You must run this command in a command prompt with elevated permissions.
Configure Group Policy for side loading
  1. Open the Group Policy Management Editor
  1. Click to expand Computer Configuration, Administrative Templates, Windows Components, and then App Package Deployment.
  1. Double-click the Allow all trusted apps to install setting.
  1. In the Allow all trusted apps to install window, click Enabled and then click OK.
  1. Setting the Group Policy to allow trusted applications updates the following registry setting: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Appx\AllowAllTrustedApps = 1
Install the prerequisites for Modern POS
  1. You can install Visual Studio Express 2013 to obtain the files, and then manually install the prerequisites for Modern POS.
  1. Download and install Visual Studio Express 2013.
  1. Copy and paste the following files to the specified locations. File1: Microsoft.WinJS.2.0.appx Copy from “\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.WinJS.2.0\1.0\ To “\Program Files (x86)\Microsoft Dynamics AX\60\Retail Modern POS\x64\Dependencies\” File2: Microsoft.VCLibs.x64.12.00.appx (64-bit operating systems only) Copy from “\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\AppX\Retail\x64\ “ To “\Program Files\Microsoft Dynamics AX\60\Retail Modern POS\x64\Dependencies\x64\” File3: Microsoft.VCLibs.x86.12.00.appx (32-bit operating systems only) Copy from “\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\AppX\Retail\x86\” To “\Program Files (x86)\Microsoft Dynamics AX\60\Retail Modern POS\x86\Dependencies\x86\ “
Manually install the prerequisites.
  1. Open a Windows PowerShell session as an administrator.
  1. Run the following command to install WinJS. Add-AppxPackage “:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Modern POS\x64\Dependencies\Microsoft.WinJS.2.0.appx
  1. Run one of the following commands to install VCLibs. On a 64-bit operating system Add-AppxPackage “:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Modern POS\x64\Dependencies\x64\Microsoft.VCLibs.x64.12.00.appx” On a 32-bit operating system: Add-AppxPackage “:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Modern POS\x86\Dependencies\x86\Microsoft.VCLibs.x86.12.00.appx”
Install Modern POS using Power Shell
Configuring Retail Server using Power Shell
Test the Retail Server
Modern POS Activation
 Troubleshooting MPOS
  1. User ‘000XXX’ logon request error – https://community.dynamics.com/ax/f/33/t/151213.aspx
  1. Wrong End point exception – https://community.dynamics.com/ax/f/33/t/151054.aspx
  1. Application error – If you face application error during Activation, then one of the causes can be the EFT setup in the Hardware profile. Make sure the EFT service is selected as Payment connector and the same is replicated in POS DB.
  1. User is not authorized – Allow Anonymous metadata in Web.config file for Retail server.
  1. Untitled.jpg
  1. Error at step 2 of mPOS activation – Setup the server name for the POS database in the Channel database form in DAX.Untitled.jpg

The Desktop Experience feature enables you to install a variety of Windows 8 features on your server running Windows Server 2012. If you use Windows Server 2012 as your primary operating system, you might want to have some of these Windows 8 features available for your daily use.
The desktop experience is not required to install for Windows 8 OS
In most cases, if you want to install and test an app, you must get a developer license for each machine on which you want to run the app.
If you aren’t using Visual Studio 2013, you can get and manage developer licenses at a command prompt by running these commands in Windows PowerShell.
Run Install-Retail Modern POS command through power shell to install Modern POS. Power Shell Command .\Install-RetailModernPOS.ps1 “C:\Program Files (x86)\Microsoft Dynamics AX\60\Retail Modern POS”
Retail server is very important component for Modern POS. Power Shell Command to deploy retail server – $Cred = @((New-Object System.Management.Automation.PSCredential(‘domain\aosadmin’,(ConvertTo-SecureString ‘Aos@admin123’ -AsPlainText -Force)))) .\DeployRetailServer.ps1 -SettingsXmlFilePath .\rs-settings-updated.xml -TopologyXmlFilePath .\rs-topology-updated.xml -Credential $Cred -Authentication $Cred Go to Retail server’s web.config and make sure RequireSSL setting is “false”
Run this URL on browser. http://:/RetailServer/v1/$metadata The output should be as shown below – 1
1. Start the Microsoft Dynamics AX Modern POS app. 2. In the Device Activation page, enter the URL for the Retail Server. After you enter the URL, the device is queued in the Microsoft Dynamics AX client where it must be approved. After the device has been approved, the client is ready to use.
There are many hurdles in installing and activating the MPOS. I am trying to consolidate the solutions and below are few which can help you in fixing the issues.
Hope this will help you install and activate the Modern POS. Do like the post and comment if you face any difficulty in installing the MPOS.

Thursday, 19 January 2017

Forms on opening hide behind in the back

In Dynamics AX 2012, when you open the forms,  you might see some of them open behind the other forms. User may get the impression that the form was never opened.  This happens if the form opened slowly;  a cold start, uniqueness of the data including large number of records or complexity of the form may cause the form to load up slowly.  The form hide behind the other form because of Windows’s ‘ForegroundLockTimeout’.
Doing the following changes to your system could fix this issue.  Since it involves changing a registry key in your system, take necessary precautions.
Create a Restore point before performing the steps below as a precaution.
Steps:
1. Open registry>> Start>>Type regedit>>press enter.
2. Locate the key:
HKEY_CURRENT_USER\Control Panel\Desktop
3. On the right pane right click on the following key and select modify:
4. ForegroundLockTimeout
5. Select Base as decimal and then type 0 (zero) in the value data box and click on Ok.
6. Exit from registry and restart the computer.
REGISTRY EDIT DISCLAIMER:
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows

Thursday, 6 October 2016

Connecting Dynamics AX to a Specific AOS Instance

When working in a Dynamics AX environment with multiple AOS instances there are times when you want to connect an AX client to a specific AOS for troubleshooting and/or testing purposes.   To bypass any load balancing create a client configuration file set up to connect to a specific AOS instance using a configuration command setting.
  1. Create a new AX Client Configuration file using the Microsoft Dynamics AX Configuration Utility.
  2. In the “Configuration command to run at kernel startup” field enter the following command
    1. -internal -loadbalance=0
  3. Save the file.
  4. Launch Dynamics AX using this new file.
When using this configuration file to launch Dynamics AX it will connect to the AOS instance that you have configured under the Connection tab and bypass any AX load balancing that is set up.

AX Configuration Utility

Wednesday, 10 February 2016

Sequence of methods in form and table in AX

Form:
Sequence of Methods calls while opening the Form
Form — init ()
Form — Datasource — init ()
Form — run ()
Form — Datasource — execute Query ()
Form — Datasource — active ()
Sequence of Methods calls while closing the Form
Form — canClose ()
Form — close ()
Sequence of Methods calls while creating the record in the Form
Form — Datasource — create ()
Form — Datasource — initValue ()
Table — initValue ()
Form — Datasource — active ()
Sequence of Method calls while saving the record in the Form
Form — Datasource — ValidateWrite ()
Table — ValidateWrite ()
Form — Datasource — write ()
Table — insert ()
Sequence of Method calls while deleting the record in the Form
Form — Datasource — validatedelete ()
Table — validatedelete ()
Table — delete ()
Form — Datasource — active ()
Sequence of Methods calls while modifying the fields in the Form
Table — validateField ()
Table — modifiedField ()

Table:
When you press CTR+N
initValue()->

When you change data in a field
validateField() -> validateFieldValue() -> ModifiedField() -> ModifiedFieldValue()

When you close the table after entering some data
validateWrite() – > Insert() -> aosValidateInsert()

When you Save the Record for the first time
validateWrite() ->Insert() – > aosValidateInsert()

When you modify the record and saving
validateWrite() -> update() – > aosValidateUpdate()

When you delete the record
validateDelete() -> delete() -> aosValidateDelete()

Monday, 21 September 2015

Dynamics AX Async Server Installation and configuration

Hi Folks,

Before we start with our new assignment of installation and configuration of of Async Server.  We need to keep few things into consideration which are as follows:

1. Set-ExecutionPolicy : The Set-ExecutionPolicy cmdlet enables you to determine which Windows PowerShell scripts (if any) will be allowed to run on your computer. Windows PowerShell has four different execution policies:
  • Restricted - No scripts can be run. Windows PowerShell can be used only in interactive mode.
  • AllSigned - Only scripts signed by a trusted publisher can be run.
  • RemoteSigned - Downloaded scripts must be signed by a trusted publisher before they can be run.
  • Unrestricted - No restrictions; all Windows PowerShell scripts can be run.
Command for Setting : Set-ExecutionPolicy Unrestricted

2. Check IIS is installed and in working Condition.
3. Check you are using Service Account for the installation of Async Server
5. Create a Self signed certificate of enterprise certificate in server where you are installing Async Server.

Now start with installation Part

Install the Async Server From Dynamics AX 2012 R3 Media

  1. Start Microsoft Dynamics AX Setup. Under Install, select Microsoft Dynamics AX components.
  2. Advance through the first wizard pages.
  3. If the Setup Support files have not yet been installed on this computer, the Select a file location page is displayed. The Setup Support files are required for installation. Provide a file location or accept the default location, and then click Next. On the Ready to install page, click Install.
  4. On the Select an installation option page, click Microsoft Dynamics AX.
  5. On the Select installation type page, click Custom installation, and then click Next.
  6. On the Select components page, select Async Server, and then click Next.
  7. On the Prerequisite validation results page, resolve any errors. For more information about how to resolve prerequisite errors, see Check prerequisites. When no errors remain, click Next.
  8. On the Configure Async Server page, select the check box to configure Async Server by using Setup. If you clear this check box, the application files are installed, but Async Server is not configured.
    If you’re configuring Async Server, enter the following information:
    • Application name – The name of the web application that hosts Async Server.
    • App pool name – The name of the application pool that the web application runs under.
      We recommend that you specify separate application pools if multiple Retail components are installed on the same computer. Multiple web applications can share an application pool if resources on the computer are limited. However, if the shared application pool fails, all of the applications that use it will stop responding. In addition, if one application is heavily used, it can negatively affect the performance of the other applications in the pool.
    • Website name – The name of the website that Async Server runs on.
    • User name and Password– The credentials for the application pool identity.
    • HTTPS port – The port on which Async Server receives HTTPS requests. You can specify any available port. Verify that the port is open in Windows Firewall, and record the port number. The port is used to create the URL for Async Server in the following format: https://<server name>:port/<web application name>. This URL is required when you configure instances of Async Client that connect to this instance of Async Server.
    • TCP port (optional) – The port on which Async Server receives TCP requests. Specify a TCP port if your environment uses high-performance data synchronization. You can specify any available port. Verify that the port is open in Windows Firewall.
    • AOS service user – The user account that the instance of Microsoft Dynamics AX Application Object Server (AOS) runs as.
    • SSL certificate thumbprint – The thumbprint for the Secure Sockets Layer (SSL) encryption certificate. You must obtain a valid, registered certificate from a provider.
  9. On the Select a database to use with Async Server page, create a new message database for Async Server. If you install a subsequent instance of Async Server for load balancing, you must select the same message database.
  10. On the Prerequisite validation results page, resolve any errors. For more information about how to resolve prerequisite errors, see Check prerequisites. When no errors remain, click Next.
  11. On the Ready to install page, click Install.
  12. After the installation is completed, click Finish to close the wizard.
If you don't want to configure the Async Server at the time of installation then you can do it manully through PowerShell
  1. Open the folder where the Windows PowerShell scripts are installed. By default, the files are located at C:\Program Files (x86)\Microsoft Dynamics AX\60\CDX\Async Server\Tools.
  2. Create a copy of the ss-settings.xml file for each instance of Async Server that you plan to deploy. We recommend that you not change the original file.
  3. Open your copy of the ss-settings.xml file in a text editor, such as Notepad. Change the parameter in the XML File.
  4. Save the changes.
  5. Open Powershell in the Administrator mode.
  6. Enter the command:  $Cred = @((New-Object System.Management.Automation.PSCredential('domain\user', (ConvertTo-SecureString 'password' -AsPlainText -Force))))
  7. Enter the edited  configuration Command :  .\DeployAsyncServer.ps1 -TopologyXmlFilePath $topologyFileName -SettingsXmlFilePath $updatedSettingsFileName -Credentials $Cred                                                                     such as Example:
    .\DeployAsyncServer.ps1 -SettingsXmlFilePath “C:\Program Files (x86)\Microsoft Dynamics AX\60\CDX\Async Server\Tools\ss-settings.xml” -TopologyXmlFilePath “C:\Program Files (x86)\Microsoft Dynamics AX\60\CDX\Async Server\Tools\ss-topology.xml” -Credentials $Cred –Verbose $true
After you configure check the services through open the url which is generated at the IIS in my case lets say 
https://nishant:8105/nishantAsync/Uploadservice.svc
format:
Https://Servername:PortNumber/AsyncInstanceName/UploadService.Svc

if the page is without error that means you are done.

Happy Daxing !!!!!




How to get the list of Fields From SQL Table

SELECT
    c.name 'Column Name',
    t.Name 'Data type',
    c.max_length 'Max Length',
    c.precision ,
    c.scale ,
    c.is_nullable,
    ISNULL(i.is_primary_key, 0) 'Primary Key'
FROM  
    sys.columns c
INNER JOIN
    sys.types t ON c.user_type_id = t.user_type_id
LEFT OUTER JOIN
    sys.index_columns ic ON ic.object_id = c.object_id AND ic.column_id = c.column_id
LEFT OUTER JOIN
    sys.indexes i ON ic.object_id = i.object_id AND ic.index_id = i.index_id
WHERE
    c.object_id = OBJECT_ID('XXXX TableName')