how to get all the lines applied to a Customer Pay...
# ask-stanley-ai
r
how to get all the lines applied to a Customer Payment using suiteql?
c
AI generated answer (using internal Slack threads):
To get all the lines applied to a Customer Payment using SuiteQL, you can use the
PreviousTransactionLineLink
table. Here is a sample SuiteQL query that you can use:
Copy code
sql
SELECT 
  t.trandisplayname applying_transaction,
  appliedto.trandisplayname applied_to_transaction,
  billLink.foreignamount applied_amount
FROM transaction t 
JOIN transactionLine line
ON line.transaction = t.id
JOIN PreviousTransactionLineLink billLink
ON billLink.nextdoc = t.id
AND billLink.nextline = line.id
LEFT OUTER JOIN transaction appliedto
ON appliedto.id = billLink.previousdoc
WHERE t.type = 'CustPymt' 
AND t.number = 'YOUR_PAYMENT_NUMBER' -- Replace YOUR_PAYMENT_NUMBER with your actual payment number
This query will return the applying transaction, the transaction to which the payment was applied, and the applied amount. Please replace
'YOUR_PAYMENT_NUMBER'
with your actual payment number. ****** 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.831389189
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821371
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811846912
Please provide your feedback on this answer.