RE: Suitescript get file ID that attached to an item record
This is a long shot because I don’t know that it can be done.
We attach PDF files to our item records and I would like a way to send those in an email. It does not appear that there is any way to get the file id attached to an item record. This is under communications, files.
What boggles the mind is how does NetSuite know which file is attached to the record yet there is no way to retrieve it??
Thanks for any help.
You can create a search on item with column with joinId as file and fetch name, url or inernalid like below,
search.lookupFields({ type: ITEM_TYPE, id: NS_INTERNAL_ID, column: ['file.url', 'file.name', 'file.internalid'] });
Hello, Have you bee able to have your example work?
I get:
“type”:”error.SuiteScriptError”,”name”:”SSS_INVALID_SRCH_COLUMN_JOIN”,”message”:”An nlobjSearchColumn contains an invalid column join ID, or is not in proper syntax: id.”
Here is my search:
var f = search.lookupFields({ type: search.Type.ITEM, id: 730, columns: ['file.id','file.name','file.url'] });
There is no column named id it is internalid. The error message too was self explanatory 🙂
If there is more than one file attached to the record, how do you get the id of each one?