can you use suiteql query to get transactions that...
# ask-stanley-ai
l
can you use suiteql query to get transactions that were emailed? (or not emailed)
c
AI generated answer (using internal Slack threads):
Based on the provided Slack threads, it appears that SuiteQL does not directly support querying transactions that were emailed or not. SuiteQL does not support joins in a way comparable to
N/search
when querying file attachments or email communications on transactions. However, you can create a saved search of email messages and their related transactions actions, and then download it as a spreadsheet. This would allow you to extract the linked email messages. Here's an example of how you can join transactions with their file attachments using SuiteScript:
Copy code
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;
});
Please note that this script is for joining transactions with their file attachments and not specifically for emailed transactions. ****** 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.833594382
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828337789
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.822796762
Please provide your feedback on this answer.