Is it possible to have a different format for the ...
# administration
b
Is it possible to have a different format for the vendor bill printing based on a condition? For example the users location?
👀 1
n
how much different format? If it is significantly different, you can have a button which calls the render API to generate PDF according to the condition. This is a customized solution.
Otherwise, you can modify the template
b
I'm happy with a customised solution. They are significantly different. I want to be able to print all vendor bills when the users location is Colombia in a different format to all other countries. How would I use the render function, is it straightforward?
n
It is not straight forward, you will need to use SuiteScript.
Why don't you set a different form based on the location and then use that print the PDF?
b
Would this allow me to have two templates or does the render function work in a different way to that?
Hmm. Yes, I could do that.... it's often the simple things we overlook!!! Thanks
👍 1
s
Long time ago I have done that by workflow and custom forms and custom templates. It was for customer invoice based on the location of the customer billing address. Workflow set the custom form to the customer based on the country and in the form country specific advanced pdf template is defined. It should also work for vendor. Currently I do have similar process working for custom PO based on the vendor's country.
p
Depending on how many different options you have it may not be practical to add forms for everything - if you mean for translation or just a slightly different format then freemarker within the adv pdf goes a long way really- just something to consider.
Copy code
<#if record.salesrep?has_content>
<tr height="20px">
<td class="details_l"><#if record.entity.language == "Suomi" || record.entity.language == "Finnish" || record.entity.language == "Finsk" || record.entity.language == "Finne">Viitteemme:<#elseif record.entity.language == "Svenska" || record.entity.language == "Swedish" || record.entity.language == "Svensk" || record.entity.language == "Ruotsi">Vår referens:<#elseif record.entity.language == "Norsk" || record.entity.language == "Norwegian" || record.entity.language == "Norska" || record.entity.language == "Norja">Vår Referanse:<#elseif record.entity.language == "Dansk" || record.entity.language == "Danish" || record.entity.language == "Danska" || record.entity.language == "Tanska">Vores reference:<#else>Our reference</#if></td>
<td>${record.salesrep}</td>
        </tr>
🎯 1
This translates 'our reference' into 4 different other languages as an example
from an invoice but same logic applies