We have a Salesforce org where they are using a custom fiscal year. The following results in a correct week number, but a null PeriodLabel:
select Id, Number, PeriodLabel from Period
When going to setup > Company Profile > Fiscal Year > 2016
I am able to see the week number (24) and the Period is 6 for today's date (6/10/2016.)
How do I access the Period via Apex? Are there multiple queries or relationships I can use to access this? When I try to soql on it directly I get the following error:
SELECT FISCAL_YEAR(CloseDate) fy FROM Case WHERE Id = '500f00000063b2sAAA' GROUP BY FISCAL_YEAR(CloseDate)
"Fiscal date calculations are not allowed when the custom fiscal year preference is enabled"