Posts

Showing posts from 2013

Available Courses For Dynamics AX 2012

Here are available Axapta certifications courses.
However there are limited certification are available till date, but study materials are available as resources/references.
Have a look on below table.



Course CodeCourse name80163AWhat's New - Application in Microsoft Dynamics® AX 2012 for Supply Chain Management and Manufacturing

80164AWhat's New - Application in Microsoft Dynamics® AX 2012 for Finance, PA, Case Mgmt., HRM and Public

80165AWhat's New - Technical in Microsoft Dynamics® AX 2012 for Implementation

80219AFinancials I in Microsoft Dynamics® AX 2012

80220AFinancials II in Microsoft Dynamics® AX 2012

80221AInstallation and Configuration for Microsoft Dynamics® AX 2012

80299AWhat's New - Technical in Microsoft Dynamics® AX 2012 for Development

80300AIntroduction to Microsoft Dynamics® AX 2012

80302AFixed Assets in Microsoft Dynamics® AX 2012

80303ADevelopment I in Microsoft Dynamics® AX 2012

80304ADevelopment II in Microsoft Dynamics® AX 2012

803…

Error: An unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected.

Image
Error: An unbalanced X++ TTSBEGIN/TTSCOMMIT pair has been detected.

Error:

When trying to create a new record(s) in any table system sows following error
eg. Sales Order and this error always appear.



Possible Reason(s):
TTS level '1' usually leaves your Ax session in an unusable state
that you can't close properly.
Check all code for form or class from where this error comes and count the ttsbegin and ttscommit there must be same like if u write 2 ttsbegin u must have to write 2 ttscommit.

Solution:
To resolve this error this TTS level should be ZERO, Run this job to get rid of that error, this job will find the tts level where its greater than zero and make it zero by calling TTSABORT.
static void TheAxaptaResetTTS(Args _args)
{
    while (appl.ttsLevel() > 0)
    {
        info(strfmt("Level %1 aborted",appl.ttsLevel()));
        ttsAbort;
    }
}

Other Info: 
ttsBegin: marks the beginning of a transaction. This ensures data integrity, and guarantees that all updates …

How to delete all the transaction inside any company in the AXapta

How to delete all the transaction inside any company in the AXapta
1. Open AOT (Ctrl +  D)
2- Open the class Node

3- Search for SysDatabaseTransDelete Class 4-Right click on the this class  select Open
6-Click yes on the message box appears 7-Info message will appear to you "operation completed"
Here we are.... All transaction data is now deleted from database.

-Harry

Method Modifiers Supported by X++

Method Modifiers Supported by X++
Method Modifiers Supported by X++ Modifier Description static Static methods are accessed via class declarations. Fields can’t be accessed from within a static method. final Final methods can’t be overridden by methods with the same name in derived classes. abstract Abstract methods have no implementation. Derived classes must provide definitions for abstract methods. server Server methods can execute only on an Application Object Server. The server modifier is allowed only on static methods. client Client methods can execute only on a MorphX client. The clientmodifiers are allowed only on static methods. display Display methods are invoked each time a form or report is redrawn. The display modifier is allowed only on table, form, form data, report, and report design methods. edit The edit method is invoked each time a form is redrawn or a user provides input through a form control. The edit modifier is allowed only on table, form, and form data s…

Abstract Class and Abstract Method in AXapta

Abstract Class and Abstract MethodAbstract Class: When we declare a class as abstract, this class cannot initiate in X++ code. To use this class or its method we have to first extend this class than only we are able to use this class or its method. To understand the abstract class consider following example We have three classes      1.absClass  (it’s an abstract class)      2.normalClass (an another class which will use the absClass methods)      3.extendAbsClass (this class will extends the absClass)
    1.abstract class absClass      {      }
    void printName()    {     ;    info("AbsClass... Deepak");     }

    2.class extendAbsClass extends absClass { }
    3.class normalClass { }
  void accessAbsClass() {     absClass        absClass;     extendAbsClass  extendAbsClass;     ;  //   absClass = new absClass();    // this declaration will throw error “Object could not be created because class absClass is abstract” so first we extend absClass into extendsAbsClass and further use extendsAbsCla…

Connecting to Databases through X++ PART -IV

Connecting to Databases through X++ PART -IV
Connection Class: Connection class is mainly used for accessing the database in which a user has logged into AX i.e. Current Database and carry out the operations. This class is exetensively used in ReleaseUpdateDB classes, the classes used in data upgrades. This class cannot be run on client and should always be run on server. One more unique thing that I noticed is that the statements that you want to execute should be asserted first for permissions and then passed on to other method where they are executed. Create a class with following methods and set its RunOn property to Server. class TestSQLExecuteClass
{
} //This method tests the permissions for statement and then calls the method that will execute the statement
static void dbConnectionClass()
{
    ResultSet   rs;
    SqlStatementExecutePermission perm;
    ;     perm = new SQLStatementExecutePermission("select * from CustTable where DATAAREAID = ‘CEU’");
    perm.assert();   …

Microsoft MVP (Most Valuable Professorial) Award 2013

Image
Hi All,

:) :) Microsoft awarded me by MVP 2013......... :)  :)

This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. I would like to say thanks to Microsoft ,MVP  team members and all blog readers who make this possible for me. Thanks again to all of you.
To read more about MVP follow below link http://blogs.msdn.com/b/mvpawardprogram/archive/2013/10/01/new-and-renewed-mvps-announced.aspx

Regards Deepak Agarwak aka Harry

Connecting to Databases through X++ PART -III

Connecting to Databases through X++ PART -IIIOLEDB Connection: OLEDB is a set of APIs designed by Microsoft and used for accessing different types of data stored in a uniform manner. Dynamics AX as such doesn’t have any specific classes built for this purpose. But one can make use of .Net Framework’s System.Data.OleDb namespace through AX’s COM Interoperability feature and use it in AX. Below is an example code that depicts this scenario: static void dbOLEDBConnection(Args _args)
{
    System.Exception                    e;
    System.Data.OleDb.OleDbConnection   objConn;
    System.Data.OleDb.OleDbCommand      cmdSelect;
    System.Data.OleDb.OleDbDataReader   reader;
    InteropPermission                   perm;
    str connectStr = "Provider=SQLNCLI.1;Integrated Security=SSPI;"+
                     "Persist Security Info=False;Initial Catalog=AX2009;Data Source= theAxapta ";
    str exceptionStr;
    ;     try
    {
        perm = new InteropPermission(InteropKind…

AX 2012 R2 VPC And Materials Download

AX 2012 R2 VPC And Course Materials Download You must have Partner Source credentials to access the following links.

Dynamics AX2012 R2 VPC
VPCLink

Dynamics AX2012 R2 Course Materials MaterialsLink

-Harry

X++ code to create & post General Journal

X++ code to create & post General JournalSome time we need to generate a General Journal through X++ code rather than go to GL module. For eg. WE are creating a journal after completion of some particular condition.
Try following code to create a General Journal and than post in in the same code through X++.

staticvoid theaxapta_CreateGLJournalPost(Args _args)
{
AxLedgerJournalTable journalTable; // class
AxLedgerJournalTrans journalTrans; // class
container acctPattern;
container offSetAcctPattern;
LedgerJournalTable ledgerJournalTable; // table
ledgerJournalCheckPost ledgerJournalCheckPost;// table
;
journalTable = new AxLedgerJournalTable();
journalTrans = new AxLedgerJournalTrans();
//Journal Name
journalTable.parmJournalName("GenJrn");
journalTable.save();
journalTrans.parmJournalNum(journalTable.ledgerJournalTable().JournalNum);
journalTrans.parmTransDate(systemDateGet());
journalTrans.parmCurrencyCode("USD");
journalTrans.parmAmountCurDebit(1200);
journalTrans.…

How to use Complex Query Ranges in Dynamics AX

Use of Complex Query Ranges in Dynamics AX      1.Adding a query with a datasource.
query = new Query();
dsInventTable = query.addDataSource(tableNum(InventTable));
// Add our range
queryBuildRange = dsInventTable.addRange(fieldNum(InventTable, DataAreaId));
    2.Simple criteria

Lets find the record where the value of ItemId field is Item1. Take note of the single quotes and parenthesis surrounding the entire expression.
queryBuildRange.value(strFmt('(ItemId == "%1")', queryValue("Item1")));
Find records where the ItemType is Service. Note the use of any2int().
queryBuildRange.value(strFmt('(ItemType == %1)', any2int(ItemType::Service)));

Find records where the ItemType is Service or the ItemId is Item1. Note the nesting of the parenthesis in this example.
queryBuildRange.value(strFmt('((ItemType == %1) || (ItemId == "%2"))', any2int(ItemType::Service), queryValue("Item1")));
Find records where the modified date is after 1st Jan…

Connecting to Databases through X++ PART -II

Connecting to Databases through X++ PART -II
ADO Connection: ADO is a set of COM objects for accessing databases or data stores. In AX we have following Classes/Objects which help to implementing ADO concept.
Class Name Description CCADOConnection Helps in establishing a connection to the target database. CCADOCommand Helps in executing a command (a Text type or a Stored procedure) CCADORecordSet Stores the data CCADOFields A collection of all fields in CCADORecordSet CCADOField A single field from the collection of fields CCADOParameter A class that helps in passing parameters that a command needs or demands
Here is an example:
static void dbCCADOConnection(Args _args)
{
    CCADOConnection connection = new CCADOConnection();
    CCADOCommand    ccADOCommand;
    CCADORecordSet  record;
    str connectStr = "Provider=SQLNCLI.1;Integrated Security=SSPI;"+
                     "Persist Security Info=False;Initial Catalog=AXDEVDB;Data Source= theAxapta";     COM     recordSet;  /*…