7px
12/01/2021, 4:16 AMAdvanced PDF/HTML Templates
? The default template it's using is terrible and can't be customized much since it's the template located in Custom PDF Layouts
.
I've tried setting the property options.formId
to the internal ID of an Adv PDF/HTML, with both the record ID and the string ID (pointlessly since the property takes in a number), to no avail.
Am I all out of options and just forced to run a saved search and compile a statement manually instead? Any and all inputs appreciated, thanks.ehcanadian
12/01/2021, 4:45 AMformid
to the id of a custom form that has the advanced template set.7px
12/01/2021, 4:55 AMNElliott
12/01/2021, 8:47 AMvar theRender = render.create();
theRender.setTemplateById(myTemplateId);
theRender.addRecord({
templateName: 'record',
record: record.load({
type: record.Type.ITEM_RECEIPT,
id: myRecordId
})
});
theRender.addRecord({
templateName: 'porecord',
record: record.load({
type: record.Type.PURCHASE_ORDER,
id: myParentId
})
});
theFinalPDF = theRender.renderAsPdf();
Note the second line, is that how you're assigning the template?7px
12/01/2021, 8:57 AMformId
property. Here's code snippet I'm using currently:
var statement = render.statement({
entityId: customerField,
printMode: render.PrintMode.HTML,
// formId: neither "custtmpl_statement" nor 109 works,
startDate: startField,
statementDate: statementField,
openTransactionsOnly: openField,
consolidateStatements: consolidateField
});
Hence my dilemma as this function seems to only want to use the Custom PDF Layouts
or Custom HTML Layouts
templates.NElliott
12/01/2021, 9:05 AM7px
12/01/2021, 9:11 AMehcanadian
12/01/2021, 1:59 PM7px
12/06/2021, 3:37 AMAdvanced PDF/HTML Template
. While they usually have their string ID displayed in the list when you open the templates' page, they also have an internal ID in the url, which I've also tried attaching in the property, but to no avail still.
I'm led to the conclusion that render.statement()
itself is hard-coded to only use the old template formats (Custom PDF/HTML Layouts
), without much options to utilize the newer ones. As of now my current solution is to just create a template using the Adv Template editor, export it as XML and manually assign it via SS2, seeing as there seems to be no other way to make this work.
Thanks for the inputs, and sorry for the late reply.ehcanadian
12/06/2021, 4:04 AM7px
12/06/2021, 5:21 AMehcanadian
12/06/2021, 2:28 PM