Tuesday, April 3, 2012

Step by Step Guide How to Install Dynamics AX 2012 - Part 1

How to Install and Configure Dynamics AX 2012 ComponentsOver the past few weeks, I was involved in installing and configuring Dynamics AX 2012 Components on couple of machines running Server 2008 and Windows 7 Enterprise O/S.

Thought I will share my experience here in a series of posts covering  installation of all major components of AX 2012 - Database, AOS, Client, EP Components, Sharepoint 2010, Reporting Services and Business Intelligence.

Overall Installation Experience/Highlights: (Good)

a. I can say compared to my previous experiences with installation of Dynamics AX 4.0 and 2009, Dynamics AX2012 is less error-prone and satisfactory even though, the number of Pre-Requisites to be installed is quite a significant one in 2012

b. Validate Pre-Requisite Tool is quite handy which helps one to prepare for installation so that one is not taken by surprise when he/she performs the actual installation of components

c. Summary Report which comes up at the end is quite cool and user-friendly.

Considerations:

a. Requires more computing power in terms of RAM (As per System Requirements Guide it says 4 GB is the minimum). And from my personal experience, I have seen that AOS service (AX32serv.exe at it's peak, especially when you start the service and bring up the AX Client first time, it goes up close to 1 GB).

b. I also tried the fully loaded image from PartnerSource  on a machine which had overall 6GB RAM, allocated 4GB to the VM, but still it was crawling. It took me ages to bring up the AOS Service.

c. Since now the AOD is no longer file based and the models reside in SQL Server, you also need to plan ahead for the disk capacity for your SQL boxes. Standard AX database (Application) along with the model database (AOD) bulks up to 3 GB approx and if you want Contoso DB (Demo Data loaded) you should free up atleast 10 GB.

Ok, Now I will jump start the installation process starting with installation of Database, AOS and Client Components. I had captured the screenshots along the way as this will help me and my peers when we setup DEV, Test, Pre-Prod and Prod Environments.

Initial Setup Screen














Pre-Requisite Validation Utility

Note - Here, I'm just installing the components which are checked below: Database, AOS, Client Components, Debugger (My favorite ;-) and Management Utilities

Tip - I would suggest from my personal experience of installing AX, even though Single-Computer Installation sounds easy and quick but we don't get the proper control here, so I prefer Custom Installation and choose my components, easy to troubleshoot and learn as we go



















This screen shows you the list of validation errors which means you need to install the base pre-requisites software before you proceed.

The first error shown below is about the SQL Server Full Text Search is not installed or the service is not running
















Launch SQL Server Setup and Install Full-Text Search component











Next, comes the Report Viewer Control. You need to download it from here http://www.microsoft.com/download/en/details.aspx?id=6442

  











Some other pre-requisites which needs to be configured and installed are as follows:



Please Note, as per the Operating System whether it's Server 2008 or Win 7, it might ask you for some other pre-requisites as well, so I would suggest you run the pre-requisite validator and please don't go by the assumption that the above  links are the ONLY pre-requisites required.

.







Once the Pre-Requisites are installed successfully, you can kick start the Installation




















Tip - You can change the location here



































Select the Components you want to install, based on your implementation topology you might want to install different components on different boxes. As I'm setting up a Sandbox at the moment, I just installed everything in one box

Didn't thought of much experimenting with Themes so left it as it is.





















You can change the database names at this step below if you want to.

















Key in the ports for AOS and Services
















Note - For demo or training purposes, it's ok to go with network service but when you are setting up for pre-prod or production environments, you should choose a proper service account for AOS Account

This is kinda cool as you have the option below to choose the installation type as Developer, Administrator or Business and accordingly it will bring up the workspace for you after the install. At this moment, I'm wearing the administrator hat :-)

All set and ready to go...























You can take a break now ;-) and come back as this step took me good 15-20 mins time!



I love this :-)
















And this too.. The Summary Report comes up quite good (This is a new installation feature in 2012 which is a brief summary of the components installed )














Next, you can go ahead with the Compile Checklist.. One other small nice feature which I like is "Processing..." pop up below, it's quite interactive unlike previous versions, where you don't know what's happening and everything looks stuck

  






Next, I will be posting my experience on other big components of AX2012 starting with Configuring EP, Sharepoint 2010, SSRS and Business Intelligence. Keep looking at this space!! Till then Happy Dax'ing...

Dynamics AX 2012 SSRS reports patterns

Here are the design pattern/changes that we need to make sure for AX 2012 SSRS report development:


Functional Area
AX2009
AX2012
Input parameters (definition)
Report
Data contract (*)
Input parameters (validation)
Report
Data contract (*)
Input dialog (simple)
Report
Data contract (*)
Input dialog (complex)
Report
UI Builder (*)
Input parameters (modification)
Report
Controller (*)
Dynamic query
Report
Query
Report data
Report
Table (temp)
Business logic
Report
RDP
Report layout
Report
SSRS Report

Upgrade Dynamics AX 4.0/AX 2009 to Dynamics AX 2012

Setup source Environment


1.      Import the PreProcessing (databaseupgrade\xpo\UpgradeAX5.xpo) XPO, located in the installation CD folder and Un check "Import with ID values:"
2.      Open the PreProcessing Checklist "SysCheckList_PreUpgrade50" located in the AX50PreUpgradeFramework project.
3.      The Preprocessing Checklist appears, if your checklists has this @ABC123 instead of text, and then do this to get the missing label file. To apply the new label files in your AX4/5 machine (if you are working with preprocessing framework):
·         Copy the label file to the label folder in your AX4/2009 machine
·         Restart the AOS
·         Label folder in AX4/2009 is a sub folder under ...\Application\Appl\ where you can find *.ald files in it.
4.      Run through the PreProcessing Checklist Items to prepare the database for Upgrade
·         If upgrading AX 2009, and the upgrade scripts don't run after opening the cockpit, jump to step #12 and follow the steps there to setup the batch server (AX4 does not require setting up a batch server). Then come back to this point and continue.
·         If upgrading AX4, You need to compile the ReleaseUpdate* classes and the ReleaseUpdateCockpit form.
·         If upgrading AX4, when running the cockpit run multiple instances of AX4:
o   Start the new Microsoft Dynamics AX client.
o   Select Basic > Periodic > Batch > Processing.
o   A batch dialog appears.
o   Add DataUpgrade in the Group field, and click OK.
5.      In the Inventory Dimension Group Upgrade checklist Item, click on the “Map dimension groups 1:1” button (Do not click on the “Assign identical groups” button) and then click on the “Set to Ready For Upgrade” button.
6.      In the System Parameters checklist Item, select “en-us” as the default language and click on the “Set to Ready for Upgrade” button.
7.      In the Company Priority setup, click on the “Set to Ready for Upgrade” button.
8.      In the Product Upgrade Form, click on the Synchronize button and then on the Product Mapping -> Map all items 1:1. Click on the “Set to Ready for Upgrade” button after doing these steps.
9.      In the Units form, click on the “Automatically assignment” button.
a.       Set all decimals to 2
b.      Set all Unit classes to “Length”
c.       Click on the “Validate” button to make sure no errors are found
d.      Click on the “Set to Ready for Upgrade” button.
10.  In the Pre-Upgrade of Unit Conversions checklist item click on the Validate button and then on the “Set to Ready for Upgrade” button.
11.  In the Pre-Upgrade of Unit Texts click on the Validate button and then on the “Set to Ready for Upgrade” button.
12.  In the Pre-Upgrade Data checklist item you might need to configure the Batch Server and Batch Server Groups if the Live PreProcessing scripts don’t start running. In order to do so, go to Administration\Setup\Server Configuration
13.  Make sure that only the machine you are using has the Is Batch Server checkbox checked. Now go to the Batch Server Groups tab and select the DataUpdate Batch Server Group
14.  Another configuration that is required to start running these jobs is the Batch Group form. You can access this in Administration\Setup\Batch Groups
15.  Select the DataUpdate Batch Group and go to the Batch Servers tab.
16.  Make sure the machine you’re running the upgrade on is on the Selected Servers list on the left side pane.
17.  After running the Live PreUpgrade, continue with the next checklist items (Validate Pre Upgrade, check Single User Mode and Single User Mode Upgrade)
18.  Once the checklist is finished, the PreProcessing stage is done. Uninstall AX50 (don’t drop the database) and you are ready to go to the AX6 steps.

Starting an Upgrade from the Target Environment


1.      Install Dynamics AX 2012.
2.      Setup Ax 2012 pointing the AOS to a new Database . Specify a different database name for the Model Database. Make sure you select the "Register Database for Upgrade checkbox:"
3.      At this stage, you should have 3 databases in your system: Database
·         The AX50 PreProcessed database
·         The new AX6 database
·         The new AX2012 model database
4.      Start AX 2012 and run through the Upgrade checklist
5.      In the Provide License Information step, specify the license.
6.      At this point, the Target Environment upgrade process is started. Make your way through the first five checklist items.

Data Upgrade Stages


Source DB connection step:
In the Source DB connection step, specify the server name where the Source Database is located and the Source Database name. Click OK once this information is entered.
PreSynchronize step:
This step loads the Upgrade cockpit. Depending on which stage you started the Upgrade Process; you might need to configure the Batch Groups and Batch Servers. Once this configuration is set, click the Run button. PreSync scripts should start running at this stage.
Create Tables Step:
This step synchronizes the database. No special steps need to be taken here.
Generate table and field mapping:
This step generates table and field mapping between source and target systems. There should be no mapping with error.
Generate Bulk Copy and Script Prioritization Step:
Bulk Copy Priorities and Script-Table dependencies are resolved in this step. No special steps need to be taken here.
Launch Data Upgrade Step:
This step loads the Upgrade cockpit. Once the cockpit is loaded, click on the Run button and the Post Sync scripts should start running.
This is where the data is actually copied from the Source Database to the Target Database based on the Mappings found in the Generate Table and Field Mapping step.

Step by Step Guide How to Install Dynamics AX 2012 SSRS and Analysis Extensions

This is the 3rd part in the series - Step by Step Installation of Dynamics AX 2012 Components:

Part 1 - Basic Dynamics AX 2012 Installation http://daxdilip.blogspot.com/2011/08/step-by-step-guide-how-to-install.html

Part 2 - Dynamics AX 2012 Enterprise Portal Installation http://daxdilip.blogspot.com/2011/08/how-to-install-dynamics-ax2012.html


INSTALL REPORTING EXTENSIONS
Run Pre-Requisite Validation

Go to the Link below and Download Cumulative Update 3 for SQL Server 2008 R2
http://support.microsoft.com/?kbid=2261464








Troubleshooting Tip (SSRS Errors)



Error during Install of AX 2012 SSRS Extensions

Microsoft.ReportingServices.WmiProvider.WMIProviderException: The profile for the user is a temporary profile. (Exception from HRESULT: 0x80090024)   at Microsoft.ReportingServices.WmiProvider.RSWmiAdmin.ThrowOnError(ManagementBaseObject mo)
   at Microsoft.ReportingServices.WmiProvider.RSWmiAdmin.ReencryptSecureInformation()
   at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.ReencryptSecureInformation()

An error occurred during setup of Reporting Services extensions.

Reason: Unable to restore the SQL Server Reporting Services encryption key. The operation failed with error code 2148073508


Solution


a. Restart the box

b. In SQL Server 2008, SSRS Reporting Configuration Manager, Under Encryption Keys, Restore the key

c. Generate Backup encryption key for the service account

d. Check you are able to browse Report Server and Report Manager URL

e. Now, Install SSRS Extensions again, it should work



Deploy Reports (Powershell)



Wait for a few mins to populate the variable, it will return back to the PS Prompt
TIP - You can also output to a file by appending out-file as shown


803 SSRS reports out of the box
Publishing reports
Note – takes around 45 mins to deploy (with some warnings which can be ignored I guess)

INSTALL/CONFIGURE ANALYSIS SERVICES
  1. Install SQL Server Analysis
  2. Restart Server










Troubleshooting Dynamics AX 2009 Reporting Extensions Installation error on SQL Server 2008

Problem -
While installing Dynamics AX 2009 Reporting Extensions on SQL Server 2008, you might run into the following error – “You must install SQL Server 2005 Reporting Services Service Pack 2 before installing the reporting extensions”. Look at the Screenshot below











Solution -
1. Locate the AX Reporting services dll from the extracted AX 2009 SP1 folder [\AX2009SP1\support\axsetupresources\microsoft.dynamics.setup.reportingservices.dll;File Version - 5.0.1000.52]
2. Copy the microsoft.dynamics.setup.reportingservices.dll into the folder: \DynamicsAX\Msi\Components32\Program Files\Microsoft Dynamics AX\Setup [since my system is 32-bit so Components32]
3. It will ask to replace the existing dll having File Version – 5.0.593.0. Say Yes and replace. Now, carry on with the installation process.
Please read this post for further information and thanks to the poster for the steps – http://community.dynamics.com/forums/t/12322.aspx

Monday, April 2, 2012

Argument Passing between Forms in Dynamics Ax 2009

Hi,
Here a sample code to pass argument to one form to another form and using of Args() class.
Steps:
1) Create two Forms named FormA and FormB
2)Use the EmplTable as the Datasource of both forms
3)Design FormA with one Grid and add 4 data fields to the Grid(EmplId,DEL_Name,Grade,EmplStatus…..)
4)Assign the datasource for the grid and the data fields
5)Add a Button in FormA
6)Override the Clicked() method and write the below code:
void Clicked()
{
Args    _args;
FormRun _formRun;
EmplId   _empId;
;
_empId = EmplTable.EmplId;  // Selected employee id in the Grid is assigned to the variable which is pass to the next form
_args = new Args(); // creating a object for args class
_args.name(formstr(VA_FormB));  // Form Menuitem
_args.caller(this);  // Form Caller(Current Form is mentioned as this)
_args.parm(_empId); // Employee Number is passed to next form[but parm() is not a best practise]
_args.record(EmplTable); // Table name is passed
_formRun = ClassFactory.formRunClass(_args); //new FormRun(_args);   // Creating object for FormRun
_formRun.init();   // Form Initialization for Load
_formRun.run();  // Form Run for process
_formRun.wait(); // Form Wait for Display
}
7) Open the Second Form – FormB
8) Add one Grid Control and set the Data Source is EmplTable
9) Add 4 data fields as same in the Form A
10)Now Override the Init() of Form
public void init()
{
parmid      _parmId;
EmplTable   _EmplTable;
//     DictTable   _dictTable;    FormBuildDataSource   _ds;    FormBuildGridControl frmGrid; // These are for dynamic Form creation so leave it
_parmId =  element.args().parm(); // Getting the argument value from the Caller
//info(int2str(element.args().record().TableId));
if(!element.args().caller())   // Check the form is called by caller or directly, if directly it throw error
throw error(“Cant Run Directly”);
if(element.args().record().TableId == tablenum(EmplTable))   // check if the sent Table and the Current form table are equal or not
{
//        _EmplTable = element.args().record();  // Assign the Received Table name to Local Variable
//_dictTable = new DictTable(element.args().record().TableId);  // leave it , is used for Dynamic Form Creation
//_ds = form.addDataSource(_dictTable.name());  // leave it , is used for Dynamic Form Creation
//_ds.table(_dictTable.id());   // leave it , is used for Dynamic Form Creation
//frmGrid = form.addControl(FormControlType::Grid, “Grid”);   // leave it , is used for Dynamic Form Creation
//frmGrid.dataSource(_ds.name());   // leave it , is used for Dynamic Form Creation
//info(strfmt(“%1     %2″,_EmplTable.EmplId,_EmplTable.DEL_Name));
//frmGrid.addDataField(_ds.id(),fieldnum(EmplTable, DEL_Name));  // leave it , is used for Dynamic Form Creation
//        EmplTable_EmplId.dataSource(_EmplTable);   // leave it , is used for Dynamic Form Creation
//        EmplTable_EmplId.dataField(fieldnum(EmplTable,EmplID));   // leave it , is used for Dynamic Form Creation
//        EmplTable_DEL_Name.dataSource(_EmplTable);   // leave it , is used for Dynamic Form Creation
//        EmplTable_DEL_Name.dataField(fieldnum(EmplTable,EmplId));  // leave it , is used for Dynamic Form Creation
//        EmplTable_DEL_Email.dataSource(_EmplTable);   // leave it , is used for Dynamic Form Creation
//        EmplTable_DEL_Email.dataField(fieldnum(EmplTable,EmplId));   // leave it , is used for Dynamic Form Creation
super();  // Form Initialization
}
else
{
info(“DataSet Not Received”);  // throw error
}
}
11)Override the Init() of the DataSource
public void init()
{
switch(element.args().dataset())// get the table id sent by caller
{
case tablenum(EmplTable):  // check the table if matches with this tableid
{
_EmplID  =   element.args().parm();  // get the argument value
query   = new Query();            queryBuildRangeProj =                                          query.addDataSource(tablenum(EmplTable)).addRange(fieldnum(EmplTable,EmplId));          // query build for the form to display
queryBuildRangeProj.value(_emplId); // Criteria for the form
EmplTable_ds.query(query); // execution of the query
break;
}
}
super(); //datasource  initialization on the form based on the criteria
}
12) Save it, and create two menu items for each.
13) It is important to change the runon property of the FormB as CalledFrom.
14)Run the FormA and select an Employee Record and click the button.
15)The FormB opens with the Related information of the Selected Employee on form.