O'Reilly logo

Microsoft Dynamics AX 2009 Development Cookbook by Mindaugas Pocius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Posting general journals

Posting journals from X++ code on the user's behalf is an inseparable supplement to journal creation explained in the Creating new general journals recipe. Normally, this operation is done right after the journal is created or later when some user action is triggered.

In this recipe, we will explore how to post general journals from X++ code. The journal we are going to process is the one we created in the Creating new general journals recipe.

How to do it...

  1. Open AOT and create a new class called JournalPost with the following code (replace 000152_010 with your journal number):
    class JournalPost
    
    {
    }
    public static void main(Args _args)
     { LedgerJournalCheckPost jourPost; LedgerJournalTable jourTable; ; jourTable = LedgerJournalTable::find('000152_010'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required