With SDF and an custom email template which does n...
# ask-stanley-ai
s
With SDF and an custom email template which does not use the file cabinet (media item), how to resolve the error : "Provide a non-empty template file."
c
AI generated answer (using internal Slack threads):
The error "Provide a non-empty template file." typically occurs when the system is unable to locate the template file you're trying to use. Since you're using SDF and a custom email template that does not use the file cabinet (media item), you need to ensure that the template is correctly referenced in your code. In SuiteScript, you can load templates via script using
render.TemplateRenderer.setTemplateById()
or
render.TemplateRenderer.setTemplateByScriptId()
. These methods allow you to set the template by its internal ID or script ID, respectively. Here's an example of how you can use these methods:
Copy code
javascript
var renderer = render.create();
renderer.setTemplateById(123); // replace 123 with your template's internal ID
or
Copy code
javascript
var renderer = render.create();
renderer.setTemplateByScriptId('custom_script_id'); // replace 'custom_script_id' with your template's script ID
Ensure that the ID or script ID you're using is correct and that the template exists in your account. If the template is not found, you will encounter the "Provide a non-empty template file." error. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.807453334
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806236804
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804603517
Please provide your feedback on this answer.