Skip to main content

When executing queries on either of the invoice or timeentry tables in the SuiteQL schema within your NetSuite connection, you may receive the following error, replacing <tablename> with the name of the table being queried:

Unable to retrieve columns for table [<tablename>].

This error may be encountered even when permissions are properly configured and when the connection is successfully tested. With this in mind, what should be done to work around the error?

NetSuite has recently informed us that each of the invoice and timeentry tables have been deprecated within the SuiteQL schema and are no longer supported. As such, any attempts to query either of these tables will cause SuiteQL to throw a search error, causing the "Unable to retrieve columns" error to appear.

As a workaround to querying the invoice table, invoice data may instead be returned within the SuiteQL schema by querying the transaction table and filtering by the recordtype column. To demonstrate, refer to the following example query:

SELECT * FROM transaction WHERE recordtype = 'invoice'

Alternatively, there is a table named Invoice exposed within the SuiteTalk schema that may be utilized for retrieving invoice data from your NetSuite instance. While SuiteTalk is an older schema than SuiteQL and does not possess the same robust support for executing SELECT queries that SuiteQL possesses, it may be beneficial to switch to utilizing this schema to gain access to additional invoice data via the Invoice table as a workaround.

In regards to workarounds for querying the timeentry table, retrieving timesheet data can be accomplished within the SuiteQL schema by instead querying the timebill table. Refer to the following example query as a demonstration:

SELECT * FROM timebill

Further, the SuiteTalk schema also exposes three additional tables that you may wish to use in order to retrieve timesheet data: the TimeBill, TimeEntry, and TimeSheet tables.

Due to these limitations of the SuiteQL schema and API provided by NetSuite, however, these will be the only workarounds for retrieving invoice and timesheet data at this time.

Should any issues persist, please reach out to [email protected] for further assistance.