
Hi,
Can someone review this X++ job I wrote for opening and holding all the fiscal periods for a calendar or legal entity?
static void OpenClose_FiscalPeriods(Args _args){FISCALCALENDAR FISCALCALENDAR;FISCALCALENDARYEAR FISCALCALENDARYEAR;FISCALCALENDARPERIOD FISCALCALENDARPERIOD;LedgerFiscalCalendarPeriod LedgerFiscalCalendarPeriod;Ledger Ledger;int row=0;while select forupdate ledgerFiscalCalendarPeriod join fiscalCalendarPeriodwhere ledgerFiscalCalendarPeriod.FiscalCalendarPeriod == fiscalCalendarPeriod.RecId && fiscalCalendarPeriod.Type == FiscalPeriodType::Operatingjoin FISCALCALENDARYEAR where fiscalCalendarPeriod.FISCALCALENDARYEAR == FISCALCALENDARYEAR.RecIdjoin FISCALCALENDAR where FISCALCALENDAR.RecId == FISCALCALENDARYEAR.FISCALCALENDAR&& FISCALCALENDAR.calendarid == 'STA_YINC2'join Ledger where Ledger.RecId == ledgerFiscalCalendarPeriod.Ledger{row+=1;info(int2str(row));ttsBegin;ledgerFiscalCalendarPeriod.Status = FiscalPeriodStatus::Open;ledgerFiscalCalendarPeriod.update();ttsCommit;}}
*This post is locked for comments
I have the same question (3)