RE: Exclude PDF attachment from email for just one transaction type

Trying to work out how/if possible to have the “Include Transaction” checkbox default as unchecked on a email message created from a quote. This will be for all quotes however we still need this default as ticked for all other transactions (sales order, invoice, purchase order etc.) I have tried a before load script on a message and this works but unable to isolate this to just quotes. I have tried to add this as a parameter to the URL to have/use a custom URL but could not get this to work.

Margie Beginner Asked on May 20, 2024 in How To's.
Add Comment
1 Answers

I’ve just done something reasonably similar. You can get the transaction ID with:

scriptContext.newRecord.getValue({ fieldId: 'transaction' })

And then a quick search for transaction should get you the type:

search.create({
    type: search.Type.TRANSACTION,
    columns: ['internalid', 'recordtype', 'type'],
    filters: [
        [
            'internalid',
            search.Operator.IS,
            scriptContext.newRecord.getValue({ fieldId: 'transaction' })
        ]
    })

I hope that helps.

Thanks,

Chris

Advanced Answered on May 21, 2024.

Thanks Chris, I don’t really have much knowledge on scripting – this is the script I have – could you provide some help as to how to combine them?

function includetransaction(type, form, request)
{
nlapiSetFieldValue(‘includetransaction’, ‘F’);
}

on May 24, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.