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')

Thursday 13 August 2015

Get Layer code from AXC File

Many time you have come across this situation where you have been given a development environment but you are not known about development code because of your client business policies.

Today i will tell you to how you can know about development code.
1. Go to Microsoft Dynamics AX Client Configuration.
2. Select the configuration
3. manage to export the configuration file to export to your local computer.
4. open the file as Text file.

In Client Configuration Development code can be viewed in encrypted form

5. search for "aol,text" in the axc file              aol,Text,<<Layer>>
6. Search for "aolcode,Text"        aolcode,Text,<<Development Code for the above founded layer>>

Saturday 21 March 2015

Ax 2012 Metadata artificats


There are three artifact types that enable the sharing of Microsoft Dynamics AX metadata between environments: XPO files, model files, and model store files.

>XPO files are development artifacts. They are typically used to move metadata between development environments.
> Model files are deployment artifacts and are the recommended vehicle for distributing solutions to customers, and for deploying builds on a test or staging environment.
>Model store files contain the metadata of your entire application, including element IDs and all other element metadata. Model store files are recommended when you deploy a solution from a staging environment to a production environment. When using model store files, you must maintain common element IDs between the source and target systems, as described later in this document.



The following table describes features of these three artifact types.

XPO files
Model files
Model store files
Installation tool
Microsoft MorphX
AXUtil.exe or Windows PowerShell cmdlets
AXUtil.exe or Windows PowerShell cmdlets
The files can be uninstalled.
No, but elements can be individually deleted.
Yes
No
The files can be signed.
No
Yes
No
Element IDs are preserved in the target model store.
All elements that already exist in the model store preserve their IDs (XPO files don’t contain IDs). For new elements, new IDs are generated.
All elements that already exist in the model store preserve their IDs. For new elements, new IDs are generated.
All element IDs on the target system become equal to the IDs stored in the model store file.
Compilation is required after installation.
Yes
Yes
No
CIL generation is required after installation.
Yes
Yes
No

Friday 9 January 2015

Simple way to import CSV File through X++

We have been importing excel file for such along time in ax. And i think this will be best example if you want to import the CSV file into AX through code.

void ImportTmpData()
{
    CommaIo          file;// = new commaIo(ItemFileName,'r');
    Container          con;
    Int                     counter;
    tmpImport        tmpImport;
    ;
   
   delete_from tmpImport;
    file = new CommaIo(fileName,'r');
    file.inRecordDelimiter("\r\n");
    file.inFieldDelimiter(",");

    if (file)
    {
        while(file.status() == IO_Status::OK)
        {
            con = file.read();
            counter++;
            if (con && counter >1)
            {
                tmpImport.field1                = conpeek(con,1);
                tmpImport.field2                = conpeek(con,2);
                 tmpImport.insert();
            }
        }
    }
}

Code to write a text file using X++

Many  time we came across situation to where we need to import data in text file.Here is a simple way to write the data into a text file.
static server void WriteTextFile(Args _args)
{ TextIo file; // Using the @ before the filename // enables us to use single path // delimiters. If you don't use it // you will have to write the path like this: FileName filename = @"c:\<<Filename.txt>>"; CarTable carTable; container con; FileIoPermission permission; #File ; try {
// Create the permission class
permission = new FileIoPermission(filename, #io_write);
// Add a request for permission before new TextIo()
permission.assert();
// Create the TextIo object
file = new TextIo(filename, #io_write);
if (!file)
throw Exception::Error;
// Specify the delimiters
file.outRecordDelimiter(#delimiterCRLF);
file.outFieldDelimiter(";");
// Loop through the data source
while select carTable
{
// Empty the container
con = connull();
// Set the data into the container
con += carTable.CarId;
con += carTable.CarBrand;
con += carTable.Mileage;
con +=carTable.Model;
con += carTable.ModelYear;
// Write the container to the file
file.writeExp(con);
}
}
catch(Exception::Error)
{
error("You do not have access to write the file to the
selected folder");
}
// Revert the access privileges
CodeAccessPermission::revertAssert();
}

Variable Symmetry has not been declared Compilation error in Ax 2012 R3

Variable Symmetry has not been declared Compilation error in Ax 2012 R3

Hello everyone,

I would like to share an information regarding Symmetry error in Microsoft Dynamics Ax 2012 R3 which come just after fresh installation . Error will be as below:

Variable Symmetry has not been declared. \Data Dictionary\Tables\PayrollEmployerTaxRegion\Methods\retrieveGNIS 12 retrieveGNIS Err:9
Variable Symmetry has not been declared. \Data Dictionary\Tables\PrlTmpGNIS\Methods\populatePrlTmpGNIS 13 populatePrlTmpGNIS Err:9
Syntax error. \Classes\PayrollCalculatePayStatementBenefits\classDeclaration 12 classDeclaration Err:9999
Syntax error. \Classes\PayrollCalculatePayStatementTaxes\classDeclaration 42 classDeclaration Err:9999
Variable Symmetry has not been declared. \Classes\PayrollSetup\refreshWorkerTaxRegionTaxes 25 refreshWorkerTaxRegionTaxes Err:9
Syntax error. \Classes\PayrollTaxCalculation\classDeclaration 7 classDeclaration Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\checkInTaxEngine 7 checkInTaxEngine Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\checkOutTaxEngine 7 checkOutTaxEngine Err:9999
Variable Symmetry has not been declared. \Classes\PayrollTaxEngineUtil\getGNISLocations 40 getGNISLocations Err:9
Variable Symmetry has not been declared. \Classes\PayrollTaxEngineUtil\getMunicipalities 39 getMunicipalities Err:9
Syntax error. \Classes\PayrollTaxEngineUtil\getPoliticalSubDivision 31 getPoliticalSubDivision Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\getPoliticalSubDivisionByTaxCode 20 getPoliticalSubDivisionByTaxCode Err:9999
Variable Symmetry has not been declared. \Classes\PayrollTaxEngineUtil\getSchoolDistricts 41 getSchoolDistricts Err:9
Variable Symmetry has not been declared. \Classes\PayrollTaxEngineUtil\getTaxEngineLocationCodeList 38 getTaxEngineLocationCodeList Err:9
Syntax error. \Classes\PayrollTaxEngineUtil\getTaxEngineVersion 10 getTaxEngineVersion Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\getTaxTableVersion 10 getTaxTableVersion Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\money2Real 11 money2Real Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\real2Hours 11 real2Hours Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\real2Money 11 real2Money Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\real2Rate 11 real2Rate Err:9999
Syntax error. \Classes\PayrollTaxEngineUtil\taxCalculation2TaxCode 11 taxCalculation2TaxCode Err:9999
Syntax error. \Classes\PayrollTaxTypeInitialization\classDeclaration 8 classDeclaration Err:9999

Scenario: 
After compiling the whole application if you get errors on tables and classes related with Standard payroll.
Then you need to follow below procedure to solve the compilation errors.

Solution:
Check whether the ste-net.dll related with payroll is available in both client and server bin.

Then in the AOT --> References node  right click and add a new reference.
click on browse and select the ste-net.dll and press ok.
Compile the classes where you are facing errors on symmetry.