Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

Friday, November 14, 2008

Inside Dynamics AX 4.0 Free eBook download at microsoft

The best technical resource available for Dynamics AX 4.0 programming is available for free download. Please download it from here . It is a must read.

Tuesday, August 5, 2008

Dynamics AX Development Training Plan

Below is a training plan i normally use to train new developers in my firm.
Task No Task Description
1.Installing AX, AX 4.0 Development Mock 1
2.Morphx IT, Chapter 3 – Data Dictionary
3. Inside Dynamics AX , Chapter 12 – The Database Layer
4.Morphx IT, Chapter 5 – Classes
5.Inside Dynamics AX, Chapter 5 – The X++ programming language
6.Morphx IT, Chapter 6 – Forms
7.Morphx IT, Chapter 7 – Reports
8.Inside Dynamics AX, Chapter 6 – Customizing Microsoft Dynamics AX
9.Inside Dynamics AX, Chapter 7 – Extending Microsoft Dynamics AX

Friday, April 4, 2008

Posting in the General Ledger (GL)


Question:
How to create a posting entry in General Ledger (GL) module of Dynamics AX?

Answer:
There are many ways to create posting entries in to General Ledger module. In my experience the simplest way is to use the Journal classes. There are two parts of posting create a heade entry and then create the add lines to it. To create a header entry use the LedgerJournalTable table and use the LedgerJournalTrans table. Finally use the ledgerJournalCheckPost class object to post these entries into the system.
Below is a job explaing the Posting process in a simple way.
static void postVoucherThroughJournal(Args _args)
{
Dialog dialog = new Dialog("Ledger Posting Example");
DialogField ledgerAccountField;
DialogField offsetAccountField;
DialogField ledgerJournalDescription;
DialogField ledgerAmount;
DialogField ledgerTransDescription;

LedgerJournalTable ledgerJournalTable;
LedgerJournalTrans ledgerJournalTrans;
LedgerJournalCheckPost ledgerJournalCheckPost;
NumberSeq numberSeq;
;
dialog.addGroup("Post Ledger Voucher");
//Add Fields
ledgerAccountField = dialog.addField(typeid(LedgerAccount), "Ledger Account");
offsetAccountField = dialog.addField(typeid(LedgerAccount), "Offset Account");
ledgerJournalDescription = dialog.addField(typeid(Name), "Journal Name");
ledgerAmount = dialog.addField(typeid(AmountCurDebit), "Debit Amount");
ledgerTransDescription = dialog.addField(typeid(Name), "Transaction Text");

if(dialog.run())
{
ttsbegin;
//STEP1: INSERT Journal Header
ledgerJournalTable.JournalName = 'Day1'; /This is the journal name.
ledgerJournalTable.initFromLedgerJournalName();
ledgerJournalTable.Name = ledgerJournalDescription.value();
ledgerJournalTable.JournalNum = JournalTableData::newTable(ledgerJournalTable).nextJournalId();
ledgerJournalTable.insert();

//STEP2: INSERT Journal Details
numberSeq = NumberSeq::newGetVoucherFromCode(LedgerJournalName::find(ledgerJournalTable.JournalName).VoucherSeries);
ledgerJournalTrans.Voucher = numberSeq.voucher();
ledgerJournalTrans.JournalNum = ledgerJournalTable.JournalNum;
ledgerJournalTrans.CurrencyCode = CompanyInfo::standardCurrency();
ledgerJournalTrans.ExchRate = Currency::exchRate(ledgerJournalTrans.CurrencyCode);
ledgerJournalTrans.AccountNum = ledgerAccountField.value();
ledgerJournalTrans.AmountCurDebit = ledgerAmount.value();
ledgerJournalTrans.TransDate = Today();
ledgerJournalTrans.OffsetAccount = offsetAccountField.value();
ledgerJournalTrans.Txt = ledgerTransDescription.value();
ledgerJournalTrans.insert();
//Post Journal into Ledger Accounts
ledgerJournalCheckPost = LedgerJournalCheckPost::newLedgerJournalTable(ledgerJournalTable, NoYes::Yes);
ledgerJournalCheckPost.run();
ttscommit;
Info(StrFmt("Journal %1 is posted", ledgerJournalTable.JournalNum));
}
}