How to get the value of the template from the cust...
# suitescript
d
How to get the value of the template from the custom transaction form? Loading a custom transaction form record using let r = record.load({ type: 'custform', id: 178 }) and trying to get the 'Print Template' value. r.getValue('advformlayout') returns null. The value exists though. Any ideas?
c
What is the use case here for getting the template ID? What are you trying to accomplish w/ the template ID? A little more info will be helpful to figure out an approach.
d
@creece Rendering the record as a PDF using TemplateRenderer.setTemplateById with the render.create method. I was hoping the custom form Id 178 would be enough but it needs the template ID 129 instead so I'm trying to load the template ID from the custom form
c
Do you have multiple PDFs that should be printed based on the form or will it always print the same PDF?
If its the same PDF, i'd make a script parameter that stores the template ID and then have your script read that template ID and use it.
d
multiple. That is why I'm trying to make it dynamic.
c
Doesn't seem like you have access to forms for scripting so you can't get to the ID. You could make the form itself dynamic but not sure how much customization you have in it. Then you can specify the template ID as a parameter and let freemarker do the dynamic part.
d
Yes, it looks that way. Just more NS inconsistencies and frustrations 😡 I appreciate your input.
d