question for those of you using One World. We wan...
# general
j
question for those of you using One World. We want to use a totally different set of Advanced PDF/HTML templates for a different subsidiary. Is the only way to achieve this to make separate custom Transaction forms and associate those with the different templates, or to put a massive #if #else in the template?
s
the problem with the form approach is that you need to have a way to ensure one subsidiary doesn’t use the other subsidiary’s form. We tried this exact thing, and within days someone violated our assumptions and used a form meant for another subsidiary (despite assurances it would never happen). So, while really, really ugly, the massive if / else approach is probably the safest and best solution. Even better, if the forms only different in small ways (colors, fonts, logos) you can sprinkle if-else statements throughout the template. But I know from recent experience that’s not always possible.
c
You could also just add buttons to the form that based on the subsidiary will use that template
s
actually, that isn’t a bad idea, and we use an approach like that for Cash Sales, where we have two Cash Sale forms, each with their own PDF template, and just a custom link on the Cash Sale to print it with the alternate form for those use cases. The only problem is people have to use the link instead of the printer button
j
the button approach won’t work as we almost entirely send the PDF to the customer using the ‘attach’ feature in the Email tool from the Sales Order.
s
I did that for PO and sales Invoice for subs and locale of the customers or vendors to include locale specific verbiage/criteria/Legal terms etc in the template. Used a workflow to set the correct distinct templates for transactions. Even did some locale based transformation using free marker codes directly in the template. Worked pretty well.
I think eons ago I posted the whole process here for some user. Or may be in Q&A site 🤔
👍 1
j
The whole template is going to be quite a different layout…. were it just chunks of freemarker here and there it would be more straightforward. Ah well, figured it was a long shot.
s
In both of my case it was the currency format, Legal terms, shipping terms, custom and tax declaration etc. so mostly static html, except for currency format for APAC and EU - used freemarker syntax
20-30 different templates
j
annoying for ours the entire layout is totally different. Sigh.
c
What does the attach feature do that sending an email and attaching it via a button won't do? I'm just curious not sure i've ever used that tool.
a
We had a customization built for us by ACS. The customer has a custom field (list of transaction forms) where we choose the template the customer should have printed. This is then sourced onto the invoice form, which has a workflow which changes the form so that it then uses the linked print template. This means we can use one UI form for all SO/IN inputs, but based on the customer setting, the print/PDF template will change. We then have 5 forms with linked templates in the background to choose from. We do use the email feature and haven't had any issues so far. We default to one form but then change as needed, but I would imagine you might be able to do something that then auto selects the template you want based on Sub on save of the customer? (I'm not that advanced but have it on the list to learn).
j
@creece the email popup doesn’t give you any option to override which template it’s printing with. It just prints the PDF using the default for that form and attaches it to the sent email.
s
It uses the templates saved to the transaction record
t
Jen, my 50 cents would be that I would recommend you do multiple transaction forms, because in some oneworld scenarios you're already required to do so because: WMS or bundle reasons, have different forms Legacy or Suitetax reasons, have different forms Transaction record basis, could have different forms - ie dictating whether or not your order to cash process ends up invoice or cash sale can be form based decisions It's a tad more hassle if layouts change but you can always save as.. The other real alternative is if the whole email thing sent out was different and some xml residing in your file cabinet, and you are doing some render magic of addcustomdatasource + n/email shenanigans
c
@jen you should still be able to do buttons then since the default functionality just prints the assigned form's PDF. On click of the print button, you can set which template to use and attach it to any record you need. Maybe I'm just missing something here?
j
what I mean is I don’t know how to override the template being used here (this is the main way we send out PDFs of transactions)
c
You could have script parameters for each subsidiaries PDF or hardcode the PDFs forms being used. On button click it can read that and use the appropriate PDF based on subsidiary to send the email and attach it to whatever records you need to. You'd never use this standard email functionality with what Im suggesting.
j
we need to use the standard email functionality (for other reasons)
we have a ton of email templates and other things (attachments etc) we need it for
👍 1
m
Save the actual templates as files in File Cabinet, and then use the PDF template to selectively
<#include>
the appropriate template based on the subsidiary. This is what we have done for statements:
Copy code
<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">

<!-- Entry point for statements for all Carsales subsidiaries that use native NetSuite statements (i.e do not use invoice consolidation). The actual statement templates are stored as files in the File Cabinet, and the appropriate template is included based on the customer's subsidiary. This is done so that there can be a single form set as the default, because NetSuite does not allow selecting the statement form on Bulk Merges, Email screen or workflows -->

<!-- 47 Appraisal Solutions Pty Ltd -->
<#if subsidiary.id = "86">
     <#include "6119773">

<!-- 320 Chileautos SpA -->
<#elseif subsidiary.id = "36">
     <#include "6119873">

<!-- 44 Redbook Inspect Pty Ltd -->
<#elseif subsidiary.id = "28">
     <#include "6119973">

<!-- 41 Tyresales Pty Ltd -->
<#elseif subsidiary.id = "9">
     <#include "6119974">

<#else>
  <pdf>
    <head></head>
    <body>
      <p>This subsidiary has not been configured for statements.</p>
    </body>
  </pdf>
</#if>
😲 1
j
Only thing is we are already HEAVILY relying on #includes in our “default” templates, and you can’t #include in an #include AFAIK.