Is there a way to pull the `accountingperiod` hier...
# suiteql
a
Is there a way to pull the
accountingperiod
hierarchy? As in, I know that
Mar 2023
should be a child of
Q1 2023
which in turn is a child of
FY 2023
. Is that explicitly in a model?
m
Looks like this is in
accountingPeriodFiscalCalendars
a
Actually it seems like there’s a hidden column that only shows up if you join… can’t do a
.parent
without joining but this works
Copy code
SELECT
	AccountingPeriod.ID,
	AccountingPeriod.PeriodName, 
	ParentPeriod.ID AS ParentPeriodID,
	ParentPeriod.PeriodName AS ParentPeriodName,
	AccountingPeriod.StartDate,
	AccountingPeriod.EndDate,
	AccountingPeriod.IsPosting, 
	AccountingPeriod.IsAdjust,
	AccountingPeriod.AllLocked,
	AccountingPeriod.ARLocked,
	AccountingPeriod.APLocked,
	AccountingPeriod.AllowNonGLChanges,
	AccountingPeriod.LastModifiedDate,
	AccountingPeriod.Closed,
	AccountingPeriod.ClosedOnDate
FROM
	AccountingPeriod 
	INNER JOIN AccountingPeriod AS ParentPeriod ON
		( ParentPeriod.ID = AccountingPeriod.Parent )
https://timdietrich.me/blog/netsuite-suiteql-accounting-periods/
m
Hmm I get
Search error occurred: Field 'Parent' for record 'accountingPeriod' was not found. Reason: REMOVED - Field is removed
when I run that query
a
strange, that does work for me
m
It's probably because I have "Multiple Calenders" feature enabled
a
oh that might come back to bite me! thank you for the pointer
d
2023.2 release note that might be related: > Prior to 2023.2, when you worked with SuiteAnalytics Connect or SOAP web services, you could use the parent field of the
AccountingPeriod
record type in your queries. As of 2023.2, the parent field of the
AccountingPeriod
record type is available only if the Multiple Calendars feature is disabled. If the Multiple Calendars feature is enabled, use the parent field of the
AccountingPeriodFiscalCalendars
record type instead.
👍 2
👍🏻 1