Posts

Showing posts from September, 2013

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;  /*…

Dynamics AX 2012 Certification Exams Details- Part II

MB6-869: Microsoft Dynamics AX 2012 Development Introduction

Preparation materials ·80303A: Development I in Microsoft Dynamics AX 2012 (2 Days) ·80304A: Development II in Microsoft Dynamics AX 2012 (2 Days)
This Exam contains following topics Understanding Dynamics AX 2012 Architecture (13 percent) ·Identify key development features and functionality. ·This topic may include: development workspace; IntelliMorph; MorphX; object-oriented design; navigation ·Demonstrate understanding of the data architecture. ·This topic may include: working with data in forms; sorting records; filtering records; finding records ·Demonstrate understanding of architecture components. ·This topic may include: layers; models; labels; Help system; reporting