I have a workflow that sends an email with the cur...
# suiteflow
d
I have a workflow that sends an email with the current record attached - is there a way to tell it to use a different template instead of the "preferred" template for the record type?
k
You could use a pretty simple custom script workflow action for this. I'm not aware of a way to do this outside of that.
d
Awesome, will look into that. Thanks as always, man!
k
You might look into this suite answers article
Copy code
Workflow Action Script> Send Email with Customized PDF Title
Published 02/25/2018 10:07 PM   |    Updated 08/05/2019 07:14 PM   |    Answer Id: 69220
d
Copy code
//Get the email subject from the custom field
 var body = nlapiGetFieldValue('custbody_email_subject'); 
 //Get the email body from the custom field
 var subject = nlapiGetFieldValue('custbody_email_body');
I think someone got that backwards 😂 But this is a great help.
Key @KevinJ of Kansas sorry to bug you, but I'm having a hard time printing with my custom template; does this look right? It's attaching the PDF just fine, but using the default template.
var file = nlapiPrintRecord('TRANSACTION', id, 'PDF', {'formnumber': 'CUSTTMPLDAVESINVOICE'});
k
Looks like you are trying to mix 1.0 and 2.0
d
I found this in the 1.0 guide 😕
I'll figure it out - thanks for looking!
k
I want to say you might have to create an alternate form for the record and assign your pdf template to that form and use the internal id of the transaction form
var file = nlapiPrintRecord('TRANSACTION', id, 'PDF',  'CUSTTMPLDAVESINVOICE');
d
Right you are - I had to make a new form and assign templates. My code worked but
formnumber
had to reference the new form, go figure. The docs were less than helpful on that one. Thanks again, Kevin