Is there a way to JOIN `accountingperiod` records ...
# suiteql
a
Is there a way to JOIN
accountingperiod
records to fiscal calendars? In querying the
fiscalcalendar
table, I see two values
Copy code
[{'links': [],
  'fiscalmonth': 'JAN',
  'id': '2',
  'isdefault': 'F',
  'name': 'January Fiscal Calendar'},
 {'links': [],
  'fiscalmonth': 'MAR',
  'id': '1',
  'isdefault': 'T',
  'name': 'March Fiscal Calendar'}]
But the
accountingperiod
records do not seem to have a field to join to fiscalcalendar. As a consequence, I cannot determine which accountingperiods are the correct ones (i.e. belong to the default fiscal year). Has anyone run into this?
m
There is a
accountingPeriodFiscalCalendars
table
a
Do you know what permission I would need to access that? I'm getting "Search error occurred: Record 'accountingPeriodFiscalCalendars' was not found" when I run
Copy code
SELECT * FROM accountingPeriodFiscalCalendars
m
Do you have
Fiscal Calendars
?
a
Hmm. I'm going to Roles > Searches > Fiscal Calendar to add the permission. Adding it seems to work fine, but when I return to the role record the permission does not appear 😕
m
You should be adding under Permissions > Lists.
That search subtab is to define which searches are available for a given record type, but if you don't select any options there isn't anything to save so makes sense it's gone when you reopen
a
It does not seem to be an option under Lists
m
Hmm do you have Multiple Calendars feature enabled?
a
Ah I think that's the issue. I am missing the permission in a client account, but the account I test with does not have that feature.
By the way, is there any way to query to determine whether a feature is enabled? Is there a SuiteQL method to recognize when Multiple Calendars is enabled?
m
There is a
CompanyFeatureSetup
table
🙏 1
SELECT isactive FROM CompanyFeatureSetup WHERE id = 'MULTIPLECALENDARS'
a
Thank you for the help!
t
There's also an "IsAvailable" column on the CompanyFeatureSetup table, which indicates if a given feature is even available. There's a query and list of a bunch of features here: https://timdietrich.me/blog/netsuite-suiteql-company-features/