Hello everyone, Anyone, please let me know, how ca...
# suitescript
a
Hello everyone, Anyone, please let me know, how can I set another template in the Print Template field on Custom Transaction form using SuiteScript.
b
you probably need to change your approach
a
So @battk is there any way to set the template?
b
not via suitescript
dont know what you are trying to do
you probably want to make your own form
or use N/render for your printing needs
a
I want to change the template according to the country which I get from the custom record.
If the country is set US or Canada on custom record then for both we just want to open a different template on Invoice record.
b
probably need to drop changing the transaction form, not going to be something done via suitescript
a
Ok, thanks @battk
b
you can do something like add your own print button that uses a suitelet to output your own rendered pdf
a
Ok, I will check this.
m
You could also check the country within the template and include additional files based on it.
s
@AB If there are other use cases for using separate forms, you could use a workflow to set the related form when the country is selected.. Then in the script you can use
render.transaction()
to get the PDF output. Otherwise, I would update the country record to have a reference to the template file, so you can ensure it's always related on the record, and not sitting hard-coded in a script.