Sunday, 1 September 2019

to get ledger calendar period status

public boolean validateLedgerPeriod(TransDate _accountingDate)
        {
            FiscalCalendarPeriod    fiscalCalendarPeriod;
            RecId                   calendarRecId;
            AccountingDate          updatedAccountingDate;
            boolean                 isOpen;
   
            calendarRecId = Ledger::fiscalCalendar(CompanyInfo::current());
            fiscalCalendarPeriod = LedgerFiscalCalendar::findPeriodByPeriodCodeDate(calendarRecId, _accountingDate, FiscalPeriodType::Operating);
   
            if (fiscalCalendarPeriod.currentLedgerPeriodStatus() == FiscalPeriodStatus::Open)
            {
                isOpen  =   true;
            }
            return isOpen;
        }

No comments:

Post a Comment