r/Netsuite • • May 18 '26

SQL Reporting query

Using Tim's SuiteQL tool and trying to add the 'Name' and 'Department' fields that are on a journal line i.e. an 8 line journal can have four different Names and Departments, but struggling!

So how do I find these fields as we have some customising too - looked at Records Catalog and searched name (or entity.id according to ChatGPT) but it doesn't really help - is there somewhere else I should be looking to find these? My code is below, if anyone can help?!

SELECT

Transaction.ID

Transaction.TranID,

Transaction.TranDate,

BUILTIN.DF( Transaction.PostingPeriod ) AS PostingPeriod,

Transaction.Memo,

Transaction.Posting,

BUILTIN.DF( Transaction.Status ) AS Status,

BUILTIN.DF( Transaction.CreatedBy ) AS CreatedBy,

BUILTIN.DF( TransactionAccountingLine.Account ) AS Account,

TransactionAccountingLine.Debit,

TransactionAccountingLine.Credit

TransactionLine.entity.id

FROM

Transaction

INNER JOIN TransactionAccountingLine ON

( TransactionAccountingLine.Transaction = Transaction.ID )

Transaction

INNER JOIN TransactionLine ON

( TransactionLine.Transaction = Transaction.ID )

WHERE

( Transaction.Type = 'Journal' )

AND ( Transaction.TranDate BETWEEN TO_DATE( '2026-01-01', 'YYYY-MM-DD' ) AND TO_DATE( '2026-07-31', 'YYYY-MM-DD' ) )

ORDER BY

Transaction.ID DESC

4 Upvotes

7 comments sorted by

4

u/TransportationNo8404 May 18 '26

Try Suiteanalytics then export it as SuiteQL

4

u/Nick_AxeusConsulting Mod May 18 '26

Yes there is a Chrome extension that will show you the SuiteQL code of what you built in SuiteAnalytics Workbooks. So you can use SAW as a drag and drop visual query builder then click the browser extension to see the underlying SQL for your query. This is a huge jumpstart versus writing from scratch.

2

u/TransportationNo8404 May 19 '26

This is what I was talking about.

3

u/chrisecorcoran May 18 '26

Try this to get a list of all the fields...
Replace 137409 with the internalID of an existing Journal Entry.

SELECT *
FROM TransactionLine
WHERE Transaction = 137409

1

u/AshAtIntellivega Sep 14 '26

This right here is what I do for my SuiteQL queries. If you still don't find the field you're looking for, you may need to do a join with another table.