Hi all I can get from a revenue recognition journa...
# suiteql
j
Hi all I can get from a revenue recognition journal line back to the revenue elements via:
previoustransactionaccountinglinelink ON nextdoc = <transactionid> AND nextline = <transactionlineid> AND linktype='RevRec'
Which references the revenue arrangement line in the
previousdoc
and
previousline
fields And from that
transactionline
I can then get back to
revenueelement
. Is there a way to get back from there to the originating invoice or credit line? There is some information that doesn't make it onto the revenue element that I need to reference. I can get back to the transaction using
source
, but it doesn't seem possible to reference an individual line.
e
I do something similar for amortization journal (think expenses instead of income, but similar overall), these are my joins. Where I have a bill you may have an invoice, and maybe replace also the isrevrectransaction for the corresponding flag for revenue journals
Copy code
FROM 
    transactionline tl //these are the journal lines
JOIN PreviousTransactionLineLink ntll  ON (tl.transaction = ntll.nextdoc  AND tl.id  = ntll.nextline)
JOIN transaction vendbill ON vendbill.id = tl.createdfrom
JOIN transaction journal ON journal.id = tl.transaction
JOIN transactionline bill_line ON (bill_line.transaction = vendbill.id AND bill_line.isrevrectransaction = 'T' AND bill_line.id = previousline)
JOIN transaction po ON po.id = bill_line.createdfrom
j
Thanks @Edgar Valdes - I will be onto vendors and employees next! For posterity, the link I'm missing above is the table sourceDetails, per https://www.reddit.com/r/Netsuite/comments/ttnvlg/comment/lflz1cq/ In the netsuite.com schema, this is on the revenue element (I think as sourceID) - I wonder why they moved it?