Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Microsoft Dynamics AX 2009 : Processing Business Tasks - Posting general journals

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
10/26/2011 9:13:18 AM
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. 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');
    jourPost = LedgerJournalCheckPost::newLedgerJournalTable(
    jourTable,
    NoYes::Yes);
    jourPost.run();
    }
  2. 2. Run the class and notice the Infolog confirming that the journal was successfully posted:

  3. 3. Optionally, open General ledger | Journals | General journal and find the processed journal to make sure it was posted.

How it works...

We create a new class called JournalPost, which will post the journal. Here, we use the system LedgerJournalCheckPost class, which does all the work. This class ensures that all necessary validations are performed. It also locks the journal so no other user can process it.

All code is located in main() of JournalPost. First, we find the journal 000152_010 created in the previous recipe.

Next, we create a new jourPost object by calling newLedgerJournalTable() on LedgerJournalCheckPost. This method accepts a journal header record to be processed and a boolean argument defining that the journal should be validated and posted or validated only. In this recipe, we set NoYes::Yes, which means that the journal will be validated and posted.

Finally, we post the journal by calling run().

Other -----------------
- Microsoft Dynamics AX 2009 : Processing Business Tasks - Creating new general journals
- Windows Small Business Server 2011 : An Email Primer (part 2) - Connecting an Exchange Server to the Internet
- Windows Small Business Server 2011 : An Email Primer (part 1) - Understanding Email Addresses & Email Server Functions
- Exchange Server 2007 : Securing Access to ActiveSync with Secure Sockets Layer Encryption (part 3) - Installing a Root Certificate on a Windows Mobile Device
- Exchange Server 2007 : Securing Access to ActiveSync with Secure Sockets Layer Encryption (part 2) - Using an Internal Certificate Authority for OWA Certificates
- Exchange Server 2007 : Securing Access to ActiveSync with Secure Sockets Layer Encryption (part 1) - Installing a Third-Party CA on a CAS
- Enabling ActiveSync in Exchange Server 2007
- Microsoft Systems Management Server 2003 : Migration Issues - Planning the Site Structure (part 2) - Running the Deployment Readiness Wizard
- Microsoft Systems Management Server 2003 : Migration Issues - Planning the Site Structure (part 1)
- Managing Microsoft Windows Server 2003 Disk Storage : Implementing RAID
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server