Thursday, 18 December 2014

Load License file in AX 2012 R3.

If you have the license file and if you want to upload it to your Ax follow following steps :

  1. Click System administration > Setup > Licensing > License information
  2. Click Load license file to import the license codes from a file.






3. The Load license file dialog box appears. Click the folder icon and browse for the license file.


4. Click OK. A message appears and asks whether you want to synchronize the database.
5.  Click Yes and that should take 20-30 mins to complete the procress.



Monday, 1 December 2014

MR installation on Ax 2012 R3 Server and Clients. (Complete steps with solutions to possible issues)

Hi Guys,
               I was doing installation of MR on our Live server and some of the clients. Although there is lot of material available it sometimes becomes difficult to seach as for every issue I needed to refer a new blog so I decided to put all thimgs together in this post. Also I will share the issues that I faced and there solutions.

Firstly I decided to install it on our live server. (Installation on Live server does not affect any current functionalities) so to perform the same the best blog is :

http://yetanotherdynamicsaxblog.blogspot.in/2013/12/installation-of-management-reporter.html

This blog clearly expalains installation on server and client.

  Only thing I want to highlight is the same media file that we use for installation on Ax 2012 R3 Server is used to install MR Client on the Ax 2012 R3 client. Just the change is while selecting the component on AX 2012R3 Client we need to just tick mark "Management Reporter Report Designer"  as shown in following screen shot and MR Client will be installed on AX 2012R3 client machine:





Now after installation of MR client on the client machine you might encounter following error when you try to start MR on AX 2012R3 Client machine:


Now this Error arises because you need to add Ax 2012 R3 Client machine to Ax 2012 R3 server with specific roles and privileges. Let us try and undestand what exactly this means.

   Firstly license need to be uploaded in MR in the server under the following path :

Ø  MR > Tools tab > Registration > add license on registration form.

This is because MR comes with limited users, and what I have observed is if you don't upload the license then MR automatically and randomly selects any 4 users and latter you cannot remove or modify the users as per your need.
                       Now after you are done with license upload you can add users to MR server as per your requirement and also you can modify the exsisting users.

            MR client can have four type of users Designer, Generator, Administrator and Viewer.
Based on what type of user you want for you Ax 2012R3 client machine you need to assign the following corresponding roles and privilages in you Ax 2012R3 server machine :

The users should be given following Roles and Privilege(that are mentioned in brackets) accordingly :

Ø  Designer: Accounting manager, Accounting Supervisor. (LedgerBalanceSheetDimMaintain)
Ø  Generator: Accountant, Accounting manager, Accounting supervisor, Chief executive officer, Chief financial officer, Compliance manager, Financial controller (LedgerFinancialJournalBGenerate / LedgerBalanceSheetDimPrintGenerate)
Ø  Administrator: Security Administrator (SysSecSecurityMaintain)

Ø  Viewer: No roles but there is a privilege. Create your own role or edit one of the existing ones if you need this MR role. (LedgerViewFinancialStatement)

After adding the approprite roles and privilages for your Ax client machine on the Ax server the MR server will automatically take the users or you can add or modify the users.

Here we complete the MR Server and client installation completely. The contents of this blog are copied and put in more simpler words by me from the following blog please refer this blog also :

http://yetanotherdynamicsaxblog.blogspot.in/2014/03/adding-users-in-management-reporter.html.





Monday, 31 March 2014

Models and Model store in ax 2012

Model and Model store : 


>> The earlier release of Microsoft Dynamics AX stores the metadata in the application files which is AOD files.  

>> In AX 2012 all the file based AOD files are replaced by SQL Server database based, which are called by Model Store.


Models and Model Files : 


>> Models are logical group of element like tables and classes.   In AX 2012 elements can be group and store in the model file.
>> Model files are easy to create, export, import and this can be uninstalled from the system when not required.
>> Each layer consists of one or more models. Each layer contains one system-generated model that is specific to that layer.
>> Every element in a layer belongs to only one model. In other words, no element can belong to two models in the same layer, and every element must belong to a model.
>> A default model owned by Microsoft exists in each layer. Default models cannot be modified.
>> A model is permanently associated with the layer that the model was created in.
>> If you need to move one of your models from one layer to another, you must create a project from the model in the Application Object Tree (AOT), export the project as an xpo file, create a target model in the desired layer, delete the original model to avoid having to resolve layer conflicts, and import the xpo file to the target model. If you are moving elements between models in the same layer, you can use the Move to model command in the AOT.

>> Models are stored in the model store. The model store is a database in which all application elements for Microsoft Dynamics AX are stored.
>> Customizations are also stored in the model store.
>> The model store replaces the Application Object Data (AOD) files that were used in earlier versions of Microsoft Dynamics AX.
>> Models that have been installed in the model store are used at run time.

>> In Microsoft Dynamics AX 2012 R2, the model store was moved into a database that is separate from the business database.

>> Models were introduced in Microsoft Dynamics AX 2012 to help partners and customers more easily install and maintain multiple solutions side by side in the same layer.

Hope this info. proves to be helpful to you... :)

Saturday, 29 March 2014

List, Set and Map in Dynamics Ax 2012 (Collection classes)

List :

      - It will hold similar datatype
      - Imp methods - elements. addstart, addend

Limitation of list - it will give in the order u/developer add - ascending or descending order  it all also allow duplicates


static void TDS_ListExample(Args _args)
{
    List l = new List(Types::String);
    ListIterator li;
    ;
   
    // limitation of list - it will give in the order u add - ascending or descending order
    // it all also allow duplicates
   
   
    l.addStart("Tendulkar");
    l.addEnd("sehwag");
    l.addEnd("gambhir");
    l.addEnd("yuvraj");
    l.addStart("haribhajan");
    l.addend("haribhajan");
   
    info(int2str(l.elements()));
   
    li = new ListIterator(l);
   
    while (li.more()) // this will return true or false -
    {
        info (li.value());
        li.next();
    }
   

}

Set : 

      - To overcome the limitations of list, we can use sets

static void TDS_SetExample(Args _args)
{
    Set s1 = new Set(Types::String);
    SetIterator si;
   
    Set s2 = new Set(Types::String);
   
    Set resultSet;
   
    // set will always result in ascending order and it will not allow duplicates
    // set can perform additional operations - union , intersection and difference
   
   
    s1.add("A");
    S1.add("z");
    s1.add("B");
    s1.add("F");
    s1.add("F");
   
    // To find any value in a set use "in" method
    if (s1.in("b") == true)
    {
        info ("b exists");
    }
    else
    {
        error ("b doesnt exists");
    }
   
   
    s2.add("A");
    s2.add("k");
    S2.add("g");
   
    info(int2str(s1.elements()));
   
    si = new SetIterator(s1);
   
    while (si.more())
    {
        info(si.value());
        si.next();
    }
   
    resultSet = Set::intersection(s1, s2);
   
    si = null;
   
    info ("Intersection");
    si = new SetIterator(resultSet);
   
     while (si.more())
    {
        info(si.value());
        si.next();
    }

   
}


Map : 

        - Map can hold a key and associated value
        - Imp methods : elements, Key, insert

static void TDS_MapExample(Args _args)
{
    // Maps are used to hold the key and correspondiong value
   
    Map m = new Map(Types::Integer, Types::String);
    MapIterator mi;
    ;
   
    m.insert(100, "Nick");
    m.insert(200, "Leo");
    m.insert(400, "Eve");
   
    mi = new MapIterator(m);
   
    while (mi.more())
    {
        info(mi.key());
        info(mi.value());
        mi.next();
    }
}

Another example to load all the records from the table to the map

Here key is accountNumber which is tring and associated value is creditlimit which is real

static void MAP_LoadTableTable(Args _args)
{
   Map m = new Map(Types::String, Types::Real);
   MEE_CustTable k;
   MapIterator mi;
 
 
   ;
 
   while select k
   {
        m.insert(k.CustomerId, k.Creditlimit);
   }
 
   info(int2str(m.elements()));
 
   info ("_______________________");
 
    mi = new MapIterator(m);
   
    while (mi.more())
    {
        info(mi.key());
        info(mi.value());
        mi.next();
    }

}


For all the classes , use iterator classes to print or get the values
ListIterator, MapIterator, SetIterator.

Note : Containers, List, Set and Map all together are called as collection classes in Dynamics Ax 2012. 

Hope u find this data useful... :)




Containers in Ax 2012 with examples.

Containers :

  - Containers are used to store different datatypes
  - Max columns in a container - 50

>> some important functions :

conlen - gives the length of the container
conpeek - gives the value of an element based on the index
conpoke - used for replacing any element with new element value
condel - willl delete the elements in cotnainer based on the start postion and number of elements to be deleted
connull - will empty the container
conins - will help to insert new elements to container
conview - to viuew the elements in the container - onyl for unit testing

confind - to find a particular element exists in container - it will give u the postiion/index

>> Just look at the following example to undestand how these methods can be applied :

static void TDS_Containers(Args _args)
{
    Container con = [1000, "Rahul", 5000.00, 56];
    container resultCon;
    int i;
    int position;
    // container limit is 50 columns
    ;
   
    // container index starts with 1
   
    // to get the length of the container
    info(int2str(conlen(con)));
   
    // to get any value based on the index use conpeek() function
    info(conpeek(con, 3));
   
    // to get all the values in one shot
   
    info("__________________________________");
   
    for ( i = 1; i <= conlen(con); i++)
    {
        info(conpeek(con,i));
    }

    info("__________________________");
   
    resultcon = condel(con, 2,2);
   
    conview(resultcon); // this should be only used for testing purpose
   
    // to nullify to empty the container
   
    //con = connull();
   
    //info(int2str(conlen(con)));
   
    //
    // To insert any new valuezs into container - use conins()
    // To replace any value in the container - use conpoke()
    // to find any value in container- use confind
   
    position= confind(con, "sreedhar");
   
    info(strfmt("sreedhar is found at %1 position", position));
}

Hope u find this useful... :)

Wednesday, 5 March 2014

Delete actions with example.

There are three types of Delete actions :

- None : The row in this table is deleted but nothing occurs in the specified table.

- Cascade : The row in this table is deleted and all the releated data in the specified table is also deleted. This ensures that no orphaned records remain after the deletion.

- Restricted : The row in this Table is only deleted if there is nothing that releats to it in the specified table. This is used when parent record should only be deleted when no child record exists, and the child record is important to keep.

- Cascade +Restricted : Behaves the same as restricted.

Advantage -

1. Data integrity -  Prevent Orphaned records (No meaningless data in database)

 Delete actions rely upon relations. First we create a relation between tables , and then create a delete action.

Delete actions are defined on Master table, you must have proper relations between tables, to perform delete actions.

 student master
Table :   studentclassdetails    studentmarkstable

Restricted says, look there is a marks record and u cannot delete a record in class table
Cascade says, okay delete a record in class table, so record in marks table are also deleted.


Example :

1. Create 3 tables
i) StudentMarksTable - 3 fields
StudentId- string, semester- string, subject -string, marks -int
                ii) Student Table
Id- string, Name- string
iii)GlobalstudentsTable
Studentid(string), name-string

Relations on StudentMarksTable, with studenttable Normal
Relation on studentable with global students table Normal


 Hope you find the data useful... :)

Table collection and Virtual company in Ax 2012

Table collections and virtual company
_____________________________________

In order to share the table data across the companies,
we will use table collections in combination with virtual companies

Create a new table by name "TS_VendorTable" and add 4 fields [VendorId, Name, Age, CreditLimit]

Go to AOT >> DataDictionary >> Table collections >> RC >> New Table collection >> Rename it to TSTC

Drag and drop TS_VendorTable table to the table collection

[Please note: Please do not add data in the table, there are high chances that data will be lost]

Go to SystemAdministration >> Setup >> Virtual company accounts >> Create a new virtual company by name "TsAc" and description as "virtual company accounts data - TS" and save the record.

Once you save the record, automatically you will find two other tabS [Company accounts, Table collections activated]

select some company accounts from right list to left list [ ceu, hyd, dat etc]
select TSTC collection from right list to left list.

Close the form, AX Client will shut down automatically.

Open new client to see HOW the sharing happens

sharing will actually happen with a field "dataareaid" in the table

data area id will be the virtual company account - "TsAc" for all those company which share the table collection.

Note : TS are my initials

Hope you find this info useful.... :)

Thursday, 13 February 2014

Views in Dynamics Ax with example and detail creation steps.

Views:
               > Like a table, a view uses fields and rows to represent data records. However, the data in a view is not stored as a database object but is dynamically created when the view is accessed. A           view uses a query to retrieve data fields from one or more database tables.

              >In Microsoft Dynamics AX, you can use views where you use tables. For example, you can use a view in a form, a report, and in X++ code. 

The following features shows the benefits of using a view instead of a table:

1. Focussed Data
2. Customized Data
3.Performance

           >When you create a view, the view definition is generated and stored in the database. When   that view is accessed, the view dynamically retrieves the data that satisfies the view definition.

           >Views will help to see the data from multiple table fields in a single window
                        [Table browser]

           >We cannot perform any DML operations on view [Create, update, delete, insert]

           >Only select query will get executed automatically when u open the view

           >Views are used on reports [extensively] and can also be used on forms

           >we cannot create any index or deleteactions on a view

           >we can never see the data in the view [ax OR FROM BACKEND] 
            Because only select query will be triggered while opening the view

View Elements:

Views are located in the Application Object Tree (AOT) under the Data Dictionary\Views node. A view     contains four primary nodes:

Metadata :
        The Metadata node contains the query or data source that the view uses to retrieve data. A        metadata query or data source is referred to as the view query.

Fields : Phyisical columns you want in your views.

Field Groups : Logical grouping of added physical columns.

Methods : Methods on Views

Example with complete steps : 


     Before starting make sure you have created two table ie. SIB_CustTable and SIB_CustTrans (SIB here
stand for south Indian Bnk but offcourse you can have your own two tables only thing is follow the steps)
Go to AOT >> DataDictionary >> Views >> RC >> New view Name it as "SIB_CustomerView" and label as "Customer and transactions view" Expand the view and you wil find important node called 'MetaData" In the metadata - we need to add all the tables in the datasources node Drag and drop SIB_CustTable to the datasource node. Expand the newly created datasource node and you will find one more datasource node inside it/within it - drag and drop SIB_custTrans table under this. Right click on the newly created child datasource and set the relations property to "Yes" Go to fields node and drag some fields from first datasource and some fields from child/second data datasource >Finally Right click and open the view, you will find that all the linked records will be displayed in the view with no DML operations >The record id in the view will be always the parent datasource recid and recversion will be always 0 >You can use this view on the form, reports etc.

Hope this is helpful to u I think you will not find the steps which I gave on any microsoft training material, so cheers :)

Sunday, 26 January 2014

Macros in Microsoft dynamics Ax

Macro :
  • Macros are reusable components
  • Macros are mostly used to remove hardcoding and for constant values
  • Macros are pre-compiled/FASTER
  • In AX, we have a macro processor
  • Macros cannot be debugged
  • Macros reduces line of code/optimizes the lines of code
  • Macros will not end with semicolon
Macros can be defined in 3 ways :


1) Local Macro
2) AOT Macro [Global macro - we can call it in all objects, tables, forms, jobs, reports etc]
3) Macro library

1) Local Macro :
                      Local macro is a mcaro which is local to that function and cannot be used outside the method/function
static void TDS_LocalMacro(Args _args)
{
#define.pi(3.142)
#define.name('Tony')
#define.address('SR Nagar, Hyd')
;
info(strfmt('%1',#pi));
info(#name);
info(#name + "is a bad person");
info(#address);
}
2) AOT Macro :
                          AOT Macros will help to resue the functions inside it.
>>Go to AOT >> Macros >> Right click on the Macros node >> New Macro >> rename it to TDSAdd 4 functions inside the macros by doubling clicking it

#define.college('SR College')
#define.age(30)
#define.inst('Vertex soft')
#define.cl(4000.00)
>>How to call AOT Macro
>>Create a new job as shown below
static void TDS_CallAOTMacro(Args _args)
{
#TDS
;
info(#college);
info(int2str#age));
}
>>How to use in any other object:
Go to TDS_CustTable >> Methods >> Override initvalue() method and paste the following code
public void initValue()
{
#TDS
;
super();
this.Creditlimit = #cl;
this.JoinedDate = systemdateget();
}
3) Macro library :
                          Microsoft has already given many macros in AOT >> Macros node
[sys] layer
we can go ahead and add any function to already existing macros [sys layer]
AOT >> Macros >> AOTExport >> open in editor and add a new function at the end
#define.marks(30)
How to call Macro library macro
static void TDS_MacroLib(Args _args)
{
#aotexport //#macrolib.aotexport
;
info(int2str(#marks));
}
How to pass values or nuMber of lines in Macros: possible
static void TDS_PassingValues_Macro(Args _args)
{
int c;
#localmacro.sum
c = %1 + %2;
#endmacro
;
#sum(10,20)
info(int2str(C));
#sum(1000,5466)
info(int2str(c));
}
Macros reduces number of lines of code as well
static void TDS_PassingValues_Macro(Args _args)
{
int c;
#localmacro.sum
c = %1 + %2;
c = c - 4;
c = c * 4/100;
#endmacro
;
#sum(10,20)
info(int2str(C));
#sum(1000,5466)
info(int2str(c));
}

Note : It is best practice to use macros only to define constants. Also TDS stands for Tushar Devendra Srivastava just using my initials as best pratice for creating my own customizations.

Hope you find it useful..... :)

Wednesday, 15 January 2014

Implementation methodology in Microsoft Dynamics Ax

Hi floks,
               Methodology for deploying Microsoft Dynamics AX is divided into the following phases:

S. NO
Phase
Tasks during phase
1
Diagnostics
  • Evaluate a customer's business processes and infrastructure
  • Prepare a proposal
2
Analysis
  • Analyze the current business model
  • Produce a gap/fit analysis
  • Create the requirements documentation
3
Design

Create documents:
  • Feature design
  • Data migration design
  • Test criteria
  • Technical design
4
Development
  • Develop the features
  • Test the features and functions
  • Create and test the user documentation
5
Deployment

  • Set up the production environment
  • Configure the system
  • Migrate data
  • Test the system
  • Train the end-users
  • Bring the system live
6
Operation
  • Resolve pending issues
  • Finalize the user documentation and knowledge transfer
  • Conduct a post-mortem of the project
  • Provide on-going support
These are on-going activities that continue after project close and throughout any future involvement with the client.
7
Optimization
  • Analyze the system to determine how it can be optimized for the best performance based on customer's needs
  • Perform the optimization
  • Carry out testing
The purpose of this phase is to help the customer optimize the benefit they get from the business solution.
8
Upgrade
  • Review the customer's business processes
  • Align the business processes with new functionality
  • Put the systems in place to support the upgrade

For more just go through this link : http://technet.microsoft.com/en-us/library/aa496439.aspx