How to Set Up the SuiteQL Query Tool

in , , May 17th, 2024
man sitting in front of table

There are times when NetSuite reports, saved searches, and analytics datasets and workbooks fall short of providing the data we need for a given task. When you’ve tried those native tools and hit their limits, then it’s time to turn to SuiteQL.

More information from the source (Tim Dietrich):

"The SuiteQL Query Tool is a NetSuite native application that can be used to run SQL queries directly within a NetSuite instance. With this free Suitelet, you can create and run SuiteQL queries, save queries to your File Cabinet, load queries from a shared hosted query library, and much more. The tool also includes the SuiteQL Tables Reference, a helpful resource for accessing information about the tables that are available in your NetSuite account."

Steps to Set Up SuiteQL

  1. Download the most recent version from NetSuite SuiteQL Query Tool Downloads
  2. Unzip the file.
  3. In NetSuite, go to Customization > Scripting > Scripts > New
  4. Click the plus (+) icon to upload the .js file you just downloaded and unzipped.
  5. Click the Create Script Record button.
  6. Name the script and click Save.
  7. Click the Deploy Script button.
  8. If only you will be using it, just click Save.
  9. Go to Customization > Scripting > Script Deployments and click View for the SuiteQL tool deployment.
  10. In the Links subtab, choose where you'd like to place a link to the tool (e.g. Classic Center > Lists > Custom > SuiteQL Query Tool).
  11. You can add this page as a shortcut in NetSuite.

SuiteQL Examples

Tim has many examples in his blog, which we highly recommend you check out! Here’s one example we used:

Use SuiteQL to Identify Inventory Impacting Transactions: We used the last query in the linked blog post to identify how many unique items were present in inventory-impacting transactions per day when performing discovery for a script. We used the following modified version to identify which inventory-impacting transaction types the customer had used.

SELECT DISTINCT 
	Transaction.type
FROM
	Transaction
	INNER JOIN TransactionLine ON
		( TransactionLine.Transaction = Transaction.ID )	
	INNER JOIN SystemNote ON
		( SystemNote.RecordTypeID = -30 )
		AND ( SystemNote.RecordID = Transaction.ID )
		AND ( SystemNote.Field = 'TRANDOC.NKEY' )
		AND ( SystemNote.OldValue IS NULL )			
WHERE
	( TransactionLine.IsInventoryAffecting = 'T' )	

Author: Nathan Wiley


Got stuck on a step in this article?

We like to update our blogs and articles to make sure they help resolve any troubleshooting difficulties you are having. Sometimes, there is a related feature to enable or a field to fill out that we miss during the instructions. If this article didn't resolve the issue, please use the chat and let us know so that we can update this article!

 
 

Want to keep learning?

Our team of NetSuite professionals has written articles on a wide variety of NetSuite topics, from SuiteCommerce tips, to recommended NetSuite solutions, to available support services, and more! 

Your cart