AX 2012: Open fiscal periods in X++

Purpose:

The purpose of this document is to describe how we can quickly open fiscal periods through X++.

Development:

// Developed on 28 Dec 2015 by Muhammad Anas Khan
// Blog: dynamicsaxinsight.wordpress.com
// LinkedIn: pk.linkedin.com/in/muhammadanaskhan
// Description: Ability to confirm purchase order
static void MAKOpenFiscalPeriods(Args _args)
{
    FiscalCalendarPeriod       fiscalCalendarPeriod;
    LedgerFiscalCalendarPeriod ledgerFiscalCalendarPeriod;

    ttsBegin;

    //Open fiscal periods
    update_recordSet ledgerFiscalCalendarPeriod
        setting Status = FiscalPeriodStatus::Open
        join fiscalCalendarPeriod
            where fiscalCalendarPeriod.RecId == ledgerFiscalCalendarPeriod.FiscalCalendarPeriod
                && fiscalCalendarPeriod.Type == FiscalPeriodType::Operating;

    ttsCommit;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s