Jeff_Idico
02/18/2025, 7:43 PMCeligo AI
02/18/2025, 7:43 PMAI generated answer (using internal Slack threads):In NetSuite, the relationship between the transaction and the file cabinet file is not directly visible or accessible via the UI or SQL. However, you can use SuiteScript to create a search that joins transactions with their file attachments. Here's an example of how you can do this:
javascript
const tranId = '123456';
const salesOrderSearchObj = search.create({
type: 'salesorder',
filters: [
['internalid', 'anyof', tranId],
'AND',
['type', 'anyof', 'SalesOrd'],
'AND',
['mainline', 'is', 'T'],
],
columns: [
search.createColumn({
name: 'internalid',
join: 'file',
label: 'Internal ID',
}),
search.createColumn({
name: 'name',
join: 'file',
label: 'Name',
}),
search.createColumn({ name: 'tranid', label: 'Document Number' }),
],
});
const searchResultCount = salesOrderSearchObj.runPaged().count;
log.debug('salesOrderSearchObj result count', searchResultCount);
salesOrderSearchObj.run().each(function (result) {
return true;
});
This script creates a search on the 'salesorder' type, filters by the transaction ID, transaction type, and mainline, and then creates columns for the internal ID and name of the file, as well as the document number of the transaction. The search results will include all transactions that have a file attached, along with the details of the attached file.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
02/18/2025, 7:43 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842077136
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816558957
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812958777
Celigo AI
02/18/2025, 7:43 PM