How would I get the account field related to a tra...
# suiteql
s
How would I get the account field related to a transactionLine ? We have a transaction & transactionLine query, but even though I can see the field account on the line level in the UI, and in NetSuite.com I could get the account_id from transaction_lines, I don’t see an account field in SuiteQL on transactionLine. The Records Catalog only shows an expenseaccount field that joins to Account, which is not the same account value I am seeing on the Journal Entry lines. Is there a linking table to join to that then provides the account?
c
transactionaccountingline
✔️ 1
s
thanks! it seems odd those field weren’t just made available directly on transactionLine, as they appear to relate 1:1
c
Netsuite works in mysterious ways 😄 ¯\_(ツ)_/¯
headbang 1
🙃 1
m
the expense account is the same account as the one on transaction accounting line from everything i’ve seen. One difference is you need expense reports enabled to access the expenseaccount transactionline value
s
For the journal entries I am looking at, they definitely do not match. I am seeing our Cash accounts listed for the expenseaccount field, but the joined transactionAccountingLine shows the revenue accounts, which is what we actually want, and what the UI shows.
m
Good to know! I will make sure not to use it then. It must just be how my account is used
s
Interesting, I wonder if it’s something to do with our setup
t
I think the reason that they split the account-related data from the transactionline table is that, in theory anyway, it's possible that a single transaction line could hit multiple GL accounts.
s
Interesting. In the older NetSuite.com schema it was all in one row/record, transaction_lines.account_id, so I wonder how they modeled for that. Or perhaps they couldn’t.