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.
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
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’);
}