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