using suiteQL how do I join the parent transaction...
# ask-stanley-ai
m
using suiteQL how do I join the parent transaction when I query a return authorization without using the transactionline to find the createdfrom
c
AI generated answer (using internal Slack threads):
To join the parent transaction when you query a Return Authorization without using the transaction line to find the
createdfrom
, you can use SuiteQL. Here's an example of how you can do this:
Copy code
SQL
SELECT 
    RA.ID AS ReturnAuthorizationID,
    RA.TranID AS ReturnAuthorizationNumber,
    SO.ID AS SalesOrderID,
    SO.TranID AS SalesOrderNumber
FROM 
    Transaction AS RA
    INNER JOIN Transaction AS SO ON RA.CreatedFrom = SO.ID
WHERE 
    RA.Type = 'RtnAuth'
In this query,
RA
represents the Return Authorization and
SO
represents the Sales Order. The
CreatedFrom
field in the Return Authorization record is used to join with the Sales Order record. Please note that this query assumes that the Return Authorization was created directly from a Sales Order. If the Return Authorization was created from a different transaction type (like an Invoice), you would need to adjust the query accordingly. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.798068762
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.795912564
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.785857
Please provide your feedback on this answer.