A sales order has several lines, each of them havi...
# ask-stanley-ai
m
A sales order has several lines, each of them having a field "job", which connects to a project. How do I get the value in this field with SuiteQL ?
c
AI generated answer (using internal Slack threads):
To get the value in the "job" field of a sales order line using SuiteQL, you would need to join to the "Project Fields". This is because the "job" field is linked to the project associated with the sales order. Here is a sample SuiteQL query that might help:
Copy code
sql
SELECT T.id, T.tranid, TL.line, TL.job 
FROM Transaction T
JOIN TransactionLine TL ON T.id = TL.transaction 
WHERE T.type = 'SalesOrd'
In this query,
T
represents the
Transaction
table and
TL
represents the
TransactionLine
table. The
job
field is in the
TransactionLine
table. Please note that this is a simplified example and you might need to adjust it according to your specific needs. Also, if you don't have the project management feature on, the job is always linked with the customer record. ****** 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.828814387
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824457586
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.815866888
Please provide your feedback on this answer.