Monday, August 25, 2014

components in ax 2012

                                              Server components

                                                   BI Components
                                                  client components
developer tools
Integration components
                                        Retail Components

Full Text Indexes on Tables

Ax 2012 provides full text functionality that enables Ax to search the business data over a large volume of text data or documents.

we can create full text indexes on tables of type Main and Group.

Before we use full text functionality in application we must configure SQL Server full text.

How to create a Full Text Index:

http://msdn.microsoft.com/EN-US/library/gg845129.aspx

How to use :

http://msdn.microsoft.com/EN-US/library/gg879757.aspx

 

TableType property in Ax 2012

In Ax- 2012 all tables have TableType property that replaces Temporary property found in Ax-2009.



Regular: The default value. These are permanent Tables.These tables are used for storing data permanently in database.

InMemory: These temporary tables are hosted in the client, the data will wipe out as soon as instance of the form or report is closed.
Joins and other Set operations with InMemory tables are usefull inefficient.
These tables are same thing as what was previously called a temporary table in ax 2009.
An InMemory table is held in memory until its size reaches 128 KB. The dataset is then written to a disk file on the server tier.
The disk file for an InMemory table has the naming convention $tmp<nnnnnnnn>.$$$.
http://msdn.microsoft.com/EN-US/library/bb314749.aspx

TempDB: This is the new type of temporary table that is hosted in the sql server database.
These temporary tables can be joined in the database with regular tables.
Joins and other Set operations on TempDB tables are can be efficient.This was the joining problem we have InMemory Tables.
http://msdn.microsoft.com/EN-US/library/gg845661.aspx

Difference between InMemory table and Container:
  • Data in containers are stored and retrieved sequentially, but an InMemory table enables you to define indexes to speed up data retrieval.
  • An index is of no benefit if you are working with only a few records. In such cases a container might involve less overhead and perform faster than an InMemory table.
Another important difference between InMemory tables and containers is how they are used in method calls.
When you pass an InMemory table into a method call, it is passed by reference.
Containers are passed by value.
When a variable is passed by reference, only a pointer to the object is passed into the method.
When a variable is passed by value, a new copy of the variable is passed into the method. If the computer has a limited amount of memory, it might start swapping memory to disk, slowing down application execution. When you pass a variable into a method, an InMemory table may provide better performance than a container.


 

Thursday, August 21, 2014

Deploy SSRS reports in Ax 2012

To deploy reports from Microsoft Dynamics AX:
  1. In the AOT, expand the SSRS Reports node. 
  2. Expand the Reports node. 
  3. Right-click the report that you want to deploy, and then click Deploy Element.
To deploy reports from Microsoft Visual Studio:
In Solution Explorer, right-click the reporting project that contains the reports that you want to deploy, and then click Deploy.
Reports are deployed for the neutral (invariant) language only.

Microsoft PowerShell:
open Windows PowerShell and view a list of the reports that are included with Microsoft Dynamics AX.
Open Windows PowerShell as an administrator by following these steps:
  1. Click Start > Administrative Tools.
  2. Right-click the Microsoft Dynamics AX 2012 Management Shell option.
  3. Click Run as administrator.
Retrieve a list of the report :
Open Windows PowerShell
$reports = Get-AXReport -ReportName *
View the list of reports by entering the following command:  
$reports
 
Deploy the reports:
 
1. Type the following command to deploy the report. Ex: CustTransList

Publish-AxReport –ReportName CustTransList.
2. To deploy multiple reports.
Publish-AxReport –ReportName Sales, SalesAnalysis.

3. Deploy All the reports.
Publish-AxReport –ReportName *

4. Deploy reports to a different server
Publish-AxReport –ReportName  -ServiceAOSName  –ServiceAOSWSDLPort
 
 

Thursday, August 7, 2014

SQL server Reporting Services (SSRS) Architecture for AX 2012


1. User requesta a report :

A menu item in the Microsoft Dynamics AX client may be bound to a report for Reporting Services. After a user clicks the menu item, a parameters form is displayed to the user. The user enters parameters to filter the data that is displayed on the report.
The Microsoft Dynamics AX client then requests the report from an instance of Reporting Services. The request includes the parameters that the user entered.

2.Reporting Services receives the request and requests the report data from the Microsoft Dynamics AX server.

Reporting Services receives the request and examines the report. The report is stored as an .rdl file. The .rdl file indicates the report’s data source. The data source may be a Microsoft Dynamics AX query, a report data provider class, or an external data source that is accessed through report data methods.
If a Microsoft Dynamics AX data source is used for the report, Reporting Services uses the Microsoft Dynamics AX data extension to retrieve the data.

Reporting Services then requests metadata about the data source from Microsoft Dynamics AX. Then Reporting Services requests the data for the report.

3.The Microsoft Dynamics AX server receives the request and sends the report data back to Reporting Services.
The Microsoft Dynamics AX services examine the query in the Application Object Tree (AOT) to return the requested metadata. The services also run the query to generate the data for the report.

Microsoft Dynamics AX then returns the metadata and data to Reporting Services.

4.Reporting Services renders the report and sends it to the Microsoft Dynamics AX client.
The Microsoft Dynamics AX customization extension formats the report. The customization extension uses metadata to provide automatic formatting of data and can affect the positioning and layout of elements on the report.
Reporting Services then renders the report into a visual representation and sends that representation to the Microsoft Dynamics AX client.

5.The report is displayed to the user.
The Microsoft Dynamics AX client displays the report to the user in the report viewer control.

Best Practices

Best Practices for Developers:

1.     Variable or constant or parameter declarations should be as local as possible to utilize memory resources in an efficient way.

2.     Unused variables, methods, and classes should be removed from the code.

3.     The re-usability should be maximized. E.g. rather than repeating lines of code at different places, a single method can be written so that changes in the method can be reflected at all the places where this method is used.

4.     A method should perform a single well-defined task and be named according to the task performed.

5.     All the text used in Dynamics AX is supposed to be in a label

6.     A try or catch deadlock or retry loop should always be created around database transactions that can cause deadlocks.

7.     Prefer switch statement rather than multiple if-else statements.

8.     Remove commented code before shipping code.

9.     Follow indentation rules.

10. Follow case rules for naming classes, methods, tables, etc.

11. Methods should perform a single well defined task and from their name the task performed should be clear.

12. To ensure trustworthiness, appropriate access levels (public, private, or protected) should be assigned.

13. Parameter's names must start with an underscore (_) character besides following other generalized naming conventions.

14. Date conversion should be avoided as it will loose date properties and hence sometimes conversion may result in wrong information.

Table:
1.     The table name may consist of the following valuable information
2.     Prefix: Module name such as Cust for Account Payable, Sales for Account Receivables
3.     Infix: Logical description of the content
4.     Post fix: Type of data e.g. Trans (for transactions), Jour (Journals), Line (table containing detailed information about a particular record in header table), Table (primary main tables), Group, Parameters, Setup, or module name to which the table belongs
5.     Label is a mandatory property and tables must be labelled using Label ID only. The text value of Label ID must be unique in all languages supported.
6.     If a table belongs to one of the four types Parameter, Group, Main, or WorksheetHeader, then it must have an associated form to maintain the table records. This form should have a name identical to its display menu item (used to start this form) and like the table name. formRef is the property of a table for the name of the associated form.
7.     Title Field 1 and Title Field 2 should be mentioned
8.     TitleField1: The key field for the records in the table. This should be a descriptive title, if the key is information for the user.
9.     TitleField2: The description for the records in the table.



Monday, August 4, 2014

Go To Main Table Functionality

1) By using jumpRef() method

in ax 2009

 
\Forms\CustTable\Designs\Design\[Tab:Tab]\[TabPage:TabCommunication]\[Group:ContactInfo]\StringEdit:editContactPersonName\Methods\jumpRef

public void jumpRef()
{
    Args        args;
    FormRun     formRun;
    ;
    args = new Args(formstr(smmContactPerson));
    args.record(custTable);
    args.parmEnum(NoYes::Yes); // It's a Go To Main Table call
    formRun = classfactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.detach();
}

2) By using formRef  property

Select Table and Go to Properties and select the required form in the formRef property

Ex: Address  Table

Enable/Disable form control based on multiple rows select

 class PurchTableFormEventHandler {      [FormDataSourceEventHandler(formDataSourceStr(PurchTable, PurchTable), FormDataSourceEventType::Act...