如何通过ODBC将NetSuite TRANSACTION_LINES与REVENUE_RECOGNITION_SCHEDULES相关联?

时间:2015-04-17 22:03:00

标签: netsuite

如何通过ODBC将NetSuite TRANSACTION_LINESREVENUE_RECOGNITION_SCHEDULES关联?

我研究过Connect Schema。虽然它表示应该可以加入REVENUE_RECOGNITION_SCHEDULES.JOURNAL_IDTRANSACTIONS.TRANSACTION_ID,但如果我尝试查找单个发票,则会发生故障。

1 个答案:

答案 0 :(得分:1)

TRANSACTION_LINES视图有一个名为SCHEDULE_ID的列,它与REVRECSCHEDULES视图中对应的SCHEDULE_ID相匹配。

SELECT 
    T.TRANID
    ,R.SCHEDULE_ID
FROM TRANSACTIONS AS T
INNER JOIN 
    TRANSACTION_LINES AS TL
    ON T.TRANSACTION_ID = TL.TRANSACTION_ID
INNER JOIN 
    REVRECSCHEDULES AS R
    ON TL.SCHEDULE_ID = R.SCHEDULE_ID
WHERE
    T.TRANSACTION_TYPE = 'Invoice'
    AND T.TRANID = 'R0356788'