Financial calendars can be created and accessed from General ledger > Setup > Financial calendars.
Fiscal calendar periods status (Open, On hold and Closed) can be changed from General ledger > Setup > Ledger >
button.
PeriodStart periodStartDate;
PeriodEnd periodEndDate;
periodStartDate =
FiscalCalendarYear::findYearByCalendarDate(CompanyInfo::fiscalCalendarRecId(), systemDateGet()).StartDate;
periodEndDate =
FiscalCalendarYear::findYearByCalendarDate(CompanyInfo::fiscalCalendarRecId(), systemDateGet()).EndDate;
periodStartDate = FiscalCalendars::findFirstDayofYear(Ledger::find(Ledger::current()).FiscalCalendar,
systemDateGet());
periodEndDate =
FiscalCalendars::findLastDayofYear(Ledger::find(Ledger::current()).FiscalCalendar,
systemDateGet());
TransDate transDate
= systemDateGet();
RecId
calendarRecId;
FiscalCalendarPeriod
fiscalCalendarPeriod;
calendarRecId = Ledger::fiscalCalendar(CompanyInfo::find().RecId);
fiscalCalendarPeriod =
FiscalCalendars::findPeriodByPeriodCodeDate(calendarRecId, transDate,
FiscalPeriodType::Operating);
checkFailed(strFmt(“@SYS17614”,date2StrUsr(transDate,
DateFlags::FormatAll)));
checkFailed(strFmt(“@SYS17615”, date2StrUsr(transDate,
DateFlags::FormatAll)));
Fiscal calendar periods status (Open, On hold and Closed) can be changed from General ledger > Setup > Ledger >

Following job can be used to get Start and End date of current Fiscal year
static void
fiscalCalendarDates(Args _args)
fiscalCalendarDates(Args _args)
{
PeriodStart periodStartDate;
PeriodEnd periodEndDate;
periodStartDate =
FiscalCalendarYear::findYearByCalendarDate(CompanyInfo::fiscalCalendarRecId(), systemDateGet()).StartDate;
periodEndDate =
FiscalCalendarYear::findYearByCalendarDate(CompanyInfo::fiscalCalendarRecId(), systemDateGet()).EndDate;
info(strFmt(“%1”,
periodStartDate));
periodStartDate));
info(strFmt(“%1”,
periodEndDate));
periodEndDate));
periodStartDate = FiscalCalendars::findFirstDayofYear(Ledger::find(Ledger::current()).FiscalCalendar,
systemDateGet());
periodEndDate =
FiscalCalendars::findLastDayofYear(Ledger::find(Ledger::current()).FiscalCalendar,
systemDateGet());
info(strFmt(“%1”,
periodStartDate));
periodStartDate));
info(strFmt(“%1”,
periodEndDate));
periodEndDate));
}
Following job can be used to get the period status (Open, On hold and Closed)
static void
checkFiscalCalendarPeriod(Args _args)
checkFiscalCalendarPeriod(Args _args)
{
TransDate transDate
= systemDateGet();
RecId
calendarRecId;
FiscalCalendarPeriod
fiscalCalendarPeriod;
calendarRecId = Ledger::fiscalCalendar(CompanyInfo::find().RecId);
fiscalCalendarPeriod =
FiscalCalendars::findPeriodByPeriodCodeDate(calendarRecId, transDate,
FiscalPeriodType::Operating);
if (transDate)
{
if (! fiscalCalendarPeriod)
{
checkFailed(strFmt(“@SYS17614”,date2StrUsr(transDate,
DateFlags::FormatAll)));
}
if
(fiscalCalendarPeriod.currentLedgerPeriodStatus() != FiscalPeriodStatus::Open)
(fiscalCalendarPeriod.currentLedgerPeriodStatus() != FiscalPeriodStatus::Open)
{
checkFailed(strFmt(“@SYS17615”, date2StrUsr(transDate,
DateFlags::FormatAll)));
}
}
}