Hi all! :wave: I’m trying to figure out how to fin...
# integrations
a
Hi all! 👋 I’m trying to figure out how to find and download attachments associated with NetSuite purchase orders and/or vendor bills through NetSuite’s API. Here’s what I know/understand so far: • the NetSuite UI allows users to attach files to purchase orders / vendor bills • we can query for NetSuite vendorbills using this SuiteQL query:
SELECT * FROM transaction WHERE transaction.type = 'VendBill'
• we can query for files using this SuiteQL query:
SELECT File.* FROM File WHERE File.id = XXX
However, I can’t figure out how to get the File ids for attachments to a purchase order / vendor bill. Does anyone know how to do this? Thank you! Any help is greatly appreciated 🙏
Related question: Is it possible to query for purchase orders through SuiteQL? Or is it only possible to access these records through the REST API? I tried querying for them using this query:
SELECT * FROM purchaseorders
but it did not work.
d
Anthony's given a good answer to your related question on your other thread.
in terms of querying attachments, it seems transaction/record attachments are not queryable via suiteQL (but they are via script with N/search...) Can't find that documented, but others have referenced the same online
a
in terms of querying attachments, it seems transaction/record attachments are not queryable via suiteQL
Ah, I see. That’s disappointing but good to know. What do you mean by
N/search
? Is that a REST endpoint I can use to query for files by purchase order?
Oh, I see. This must be what you’re referring to: https://netsuitediagnostics.com/posts/suitescript-api-search/
N/search
can only be used with SuiteScript though, right? Is there any way to query for files attached to a PurchaseOrder using a REST API?
d
yes, the search module is used with suitescript only. I do not know of a way to get attachments via rest api