Wednesday, August 27, 2014

Local functions

Local functions

Local functions are the functions that placed in another method. In AX, we can add local functions inside to the job or class methods but we can’t add local functions inside the local function, it is restricted. Local functions are used to separate the business logics. The best practice is to avoid to use local functions, instead of this we can create private methods.
 

Create local function:

Local function should be placed end of the declaration part.
Note: we can’t declare the variable next to the local functions.
 

Scope of variables:

Local function can access the method variables. For example, Localfunction1 can access the Hari_LocalFunctions method i variable. But Hari_LocalFunctions method can’t access the local function variables (Localfunction1 function j variable)
 

Calling local functions:

We can call the local function as usual method of calling method or function like Localfunction1().
We can call the local function from top level declared local function. For example, we can call the localFunction1 local function from localFunction2 local function, but we can’t call the localFunction2 from localFunction1 local function. Because the localFunction2 is declared next to the localFunction1 local function.
Local function is also supporting recursive function calling method. Note: We should be careful when we using recursive function.
 

Example code:

I have created the job for your better understanding.
 
static void Hari_LocalFunctions(Args _args)
{
    int i = 1;
    void localFunction1()
    {
        int j = 2;
        info(strFmt('Method 1 - %1', i));
    }
    void localFunction2()
    {
        info(strFmt('Method 2 - %1', i));
        localFunction1();
    }
    ;
    localFunction1();
    localFunction2();
}

Sunday, August 17, 2014

Navigation

Navigation

Navigation helps the end user to navigate to forms or reports easily. In AX navigation are grouped by application modules. For example the accounts receivable navigation found under the Application receivable module. We can add new forms or reports in the navigation. It will reflect in the area page or navigation pane. The list page and area page are navigation pages. Navigation pages means this pages contains links to other pages. We can separate the navigation section by the followings.

Address bar

Address bar is displayed in the top of the page like the browser's address bar. It displays the the address very friendly to the end user to understand the form flows. For example: Accounts receivable\Common\Customers. We can't change the order of the menus and menus text directly in the address bar but, we can change these by changing the menus and menu items. Address bar contains forward, back and history buttons.

Application module

Application module is a collection of business functionality is mapped together. For example, accounts receivable is a application module, this module contains the accounts receivable related activity forms and reports. We can navigate or change to another application module by clicking the drop down of the address bar or by using the navigation pane.

Area page

Area page is the main and first page to the application module. The area page contains the links to the forms or reports. All forms and reports links are together in the area page.

List page

List page is a page that displaying the data in the grid. The user can open the details page (content page) by double clicking the data of the list page. The list page is also consider as navigation page.

The design elements of a list page

Content page

Content page is the details page of the information. The insert or update screens is also called as content page. It displays the content of the information. For example customer creation forms is the content page. Sometimes, the content page is opened from the list pages. The content page may contains action pane, grid and datasources.

Navigation pane

Navigation pane displays left side in the application workspace (AX client). It display the selected application modules forms and reports links. It helps the end user to navigate to the form or reports easily. This navigation pane has the following sections. Please be careful to choose the following section when you add the newly customized forms or reports. For example, if you want to add the customized setup form, please choose the setup section and add your form under this section. So, the user don't  get confused.
  • Favorites
  • Area page
  • Common
  • Journal
  • Inquiries
  • Reports
  • Periodic
  • Setup

Favorites

The end user can add mostly using forms and reports under the favorites section by right clicking on the forms or reports link and select the add to favorites menu options. By using this favorites, the user no need to spend more time to find the mostly using forms.

Area page

Area page section links for navigate to area page.

Common

This section contains the mostly using forms. So, the user no need to find in other sections.

Journal

Journal related forms are listed under this section

Inquiries

Inquiry related forms are listed under this section

Reports

All reports are listed under this section.

Periodic

The forms that used to run based on the schedule like monthly, weekly or daily.

Setup

Setup related forms are listed under this section. The setup forms contains the parameters to achieve the business logic.

Role center page

Role center page is the first or main page to the Enterprise portal. For more information about the role center page, please refer this link.

Monday, August 11, 2014

AX 2012 - Development workspace

AX 2012 - Development workspace

Development workspace is a work area to developer for customize the forms, reports and menus. Development workspace contains AOT, Label editor and developer related tools. MorphX is a AX 2012 developer IDE and it works in development workspace. Development workspace only works if you installed the developer licenses otherwise the option should be disabled. We can work with maximum eight workspace. It may be development workspace or application workspace or both (For example: 3 development workspace and 5 application workspace). Application workspace is a user interface for end user. Developer customization works will be displayed in the application workspace.

Open the development workspace

Method 1:

Default, when you open the AX 2012 the application workspace will be displayed. But, the developer needs to open the development workspace first instead of application workspace. So, we can add -development parameter in the target path like below.

Right click on the AX 2012 shortcut icon and change add the -development in the target path like "C:\Program Files\Microsoft Dynamics AX\60\Client\Bin\Ax32.exe" -development

Method 2:

Click the windows menu on the top right in the application workspace and click the Development workspace menu or simply use the shortcut Ctrl+Shift+W for development workspace Ctrl+W for application workspace.

Method 3:

We can open the development workspace by using x++ code like below. For example we can add button in forms to open the development workspace by clicking this button.

static void OpenDevWorkspace(Args _args)
{
    int hWorkspace;
    hWorkspace = infolog.createDevelopmentWorkspaceWindow();
}

infolog class is used to retrieves the workspace information like license code, open the development workspace, open the application workspace, shutdown the client, read the AOT elements, etc..

Thanks,
Hari

Sunday, August 10, 2014

MorphX and Intellimorph

MorphX & IntelliMorph:

Here, i explain what is MorphX and IntelliMorph in AX 2012.

MorphX:

MorphX is an integrated development environment (IDE) of Microsoft Dynamics AX. MorphX is used to modify forms, reports, tables, menus, etc. If we need to create or modify (customize) AX objects like forms and reports we need to use this MorphX IDE. MorphX IDE only works if you installed the developer license in your Microsoft Dynamics AX.

MorphX is an easy tool to developer. The developer can create forms, menus, tables, manage labels and reports in easy manner by using this IDE.

X++ is a object oriented programming language. It is used in MorphX IDE.

Please refer the below link for full details about MorphX.
http://msdn.microsoft.com/en-us/library/aa853691.aspx

IntelliMorph:

IntelliMorph is an runtime environment in Microsoft Dynamics AX. It helps lot to developer. It works that how user interface is displayed to the user. I mean the appearance. The developer adding the fields in the forms but the IntelliMorph technology is displaying the fields in the form with correct appearance like width, height, etc.. So, it reduces the developers work. The developer no need to worry about how the controls appears on the forms and reports.

For example:
If the developers set column width to the width property of the the grid mean the grid width should appear based on the form's width. Mean the grid occupy the full width of the form or parent control width. As per this settings the IntelliMorph works to display the grid in the full size.

Everything related about appearance of the form is managed by IntelliMorph.


Thanks,
Hari

Saturday, August 9, 2014

AX 2012 - Development introduction Microsoft certification - MB6-869

Hi Friends,

Microsoft development certification is worth full and companies are expecting the employees gets the Microsoft certification. The companies are benefited by having certified employees. The companies consider the certified candidate in the recruitment time. We can improve the knowledge by doing the certification.

In AX 2012, Microsoft conduct the development certification (MB6-869). Here, i have included the skills mentioned for this certification.

1.       Understand Microsoft Dynamics AX 2012 architecture (13%)
a.       Identify key development features and functionality
                                                               i.      Development workspace, IntelliMorph, MorphX, object-oriented design, navigation
b.      Demonstrate understanding of the data architecture
                                                               i.      Work with data in forms, sort records, filter records, find records
c.       Demonstrate understanding of architecture components
                                                               i.      Layers, models, labels, Help system, reporting
d.      Work with customization tools
                                                               i.      Use MorphX to customize the user interface, use the X++ editor to develop customizations, identify best practices, use the Type Hierarchy Browser and Type Hierarchy Context tools, use the reverse engineering tool
2.       Manage the data dictionary (13%)
a.       Work with MorphX, the Application Object Tree (AOT), and projects
                                                               i.      Work with development projects, features of the AOT, Microsoft Visual Studio projects node, objects in the data dictionary, navigate the AOT and data dictionary
b.      Work with tables and relations
                                                               i.      Table structure and components, fields, field groups, indexes, delete actions, create tables, create relations, primary keys, foreign keys, surrogate keys
c.       Work with data types and base enumerations
                                                               i.      Primitive types, extended types, create data types, use data types, create base enumerations, use base enumerations
d.      Work with maps and views
                                                               i.      Map functionality, map advantages, view functionality, view advantages
3.       Manage the user interface (13%)
a.       Work with menus and menu items
                                                               i.      Create and use menu items, menu functionality, create menus
b.      Manage forms
                                                               i.      Data sources, design, document view, edit data in a form
c.       Work with forms
                                                               i.      Form types, list pages and list page metadata, work with the action pane, form parts
4.       Manage security (11%)
a.       Work with role and task based security
                                                               i.      Identify key concepts, terms, and benefits; work with roles, process cycles, and duties; work with privileges, entry points, and permissions
b.      Understand security concepts and settings
                                                               i.      Default security settings, sample security settings
c.       Work with XDS and server enforcement of security
                                                               i.      Server-based code authentication, data security filters, org model, effective date
5.       Work with X++ control statements (13%)
a.       Work with variables
                                                               i.      Declaration, simple data types, composite data types, arrays, containers
b.      Work with operators
                                                               i.      Assignment operators, arithmetic operators, relational operators, operator precedence
c.       Work with conditional statements and loops
                                                               i.      If…else, ternary, switch, while loops, do…while loops, for loops
d.      Work with communication tools
                                                               i.      Print, boxes, infolog, dialog
6.       Manage objects and classes (12%)
a.       Work with classes, objects, and inheritance
                                                               i.      Define key attributes, method access control, extend a class, expression operators for inheritance, reference object methods, method types, inheritance among tables
b.      Work with scoping, events, and parameters in X++
                                                               i.      Scope of objects within a class, events in X++
7.       Access the database (15%)
a.       Retrieve data
                                                               i.      Table buffers, select statements, field lists, while select statements, sort, joins, cross-company data access
b.      Manipulate data
                                                               i.      Insert, update, insert_recordset, update_recordset, delete, delete_from, transaction tracking system
c.       Work with queries
                                                               i.      Execute a query, build a query, QueryBuildDataSource, QueryBuildRange
8.       Manage exception handling (10%)
a.       Work with exceptions and optimistic concurrency exceptions
                                                               i.      Handle errors
b.      Work with throw and try/catch commands
                                                               i.      Handle errors

Please go to this link and get full details about the MB6-869 exam https://www.microsoft.com/learning/en-us/exam-mb6-869.aspx

Please refer the below link to prepare for AX 2012 development introduction certification. The author of the below link, listing the skills mentioned in the Microsoft certification site and linked the topics with content for further study

http://axandhellisfunafterall.blogspot.in/2014/02/exam-mb6-869-microsoft-dynamics-ax-2012.html

Thanks,
Hari

AX 2012 - Database entity relationship diagrams

Hi Friends,

The database diagram is very useful to find the relationship between the tables and it helps to understand the flow. So, mostly i prefer to find the diagrams in the SQL server, but in AX there is no option to create diagram in development workspace.

Microsoft lunched the AX database relationship website it helps to understand the tables relationship.

Please have a look on this website http://www.microsoft.com/dynamics/ax/erd/ax2012r2/Default.htm


The below screenshots explains what are the tables related with vendor transactions.


ERD, centered on 'VendTrans'.

Thanks,
Hari

Friday, August 8, 2014

Introduction

Hi Friends,

I have planned to share my knowledge regarding Dynamics AX technical. If you need any help regarding AX, you can contact me.


Thanks,
Hari