the fields on a transaction that are returned from...
# ask-stanley-ai
l
the fields on a transaction that are returned from a get request are diffferent from the ones in suiteql (for example, subtotal exists in the get response but not in suiteql) How can I get the subtotal from suiteql, and where can I find documentation of available columns in suiteql=
c
AI generated answer (using internal Slack threads):
In SuiteQL, you can't directly get the subtotal field as it's not available. However, you can calculate it by subtracting the shipping amount and tax total from the total amount. Here is an example of how you can do it:
Copy code
sql
SELECT {amount} - NVL({shippingamount},0) - NVL({taxtotal},0) AS subtotal FROM transaction
This will give you the subtotal for each transaction. Please replace the field names with the actual field names in your database. As for the documentation of available columns in SuiteQL, you can refer to the NetSuite Records Browser. It provides a list of all the standard records in NetSuite and their fields, which you can use in your SuiteQL queries. You can access it from the following URL: https://www.netsuite.com/portal/developers/resources/apis/records-browser.shtml ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826337934
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823354185
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817642629
Please provide your feedback on this answer.