Does anyone know how to get class from a transacti...
# suiteql
a
Does anyone know how to get class from a transaction with SuiteQL?
t
@Andrew Class is actually stored on the TransactionLine. So you can join from the Transaction header to the mainline, like this:
Copy code
SELECT
	Transaction.TranID,
	Transaction.TranDate,
	BUILTIN.DF( Transaction.Type ) AS Type,
	BUILTIN.DF( Transaction.Status ) AS Status,
	BUILTIN.DF( Transaction.Entity ) AS Entity,
	BUILTIN.DF( Transaction.Employee ) AS Employee,
	BUILTIN.DF( TransactionLine.Item ) AS Item,
	TransactionLine.Quantity,
	TransactionLine.Rate,
	BUILTIN.DF( TransactionLine.Class ) AS Class
FROM
	Transaction
	INNER JOIN TransactionLine ON
		( TransactionLine.Transaction = Transaction.ID )
		AND ( TransactionLine.MainLine = 'T' )
WHERE
	( Transaction.TranDate >= BUILTIN.RELATIVE_RANGES( 'DAGO7', 'START' ) )