When working with SuiteQL how do I get project id ...
# ask-stanley-ai
a
When working with SuiteQL how do I get project id and project name from the sales order line.
c
AI generated answer (using internal Slack threads):
To get the project id and project name from the sales order line using SuiteQL, you would need to join the
transaction
table with the
transaction_line
table and the
job
table. The
job
table in NetSuite is where project records are stored. Here is a sample SuiteQL query that might help:
Copy code
sql
SELECT T.id AS sales_order_id, T.tranid AS sales_order_number, TL.line AS line_number, J.id AS project_id, J.companyname AS project_name
FROM transaction T
JOIN transaction_line TL ON T.id = TL.transaction_id
JOIN job J ON TL.job = J.id
WHERE T.type = 'SalesOrd'
This query will return the sales order id, sales order number, line number, project id, and project name for each line of every sales order that has a project associated with it. Please note that the actual field names and table names may vary depending on your NetSuite account setup, so you may 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.838623166
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833313107
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830810666
Please provide your feedback on this answer.