- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2026 04:00 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2026 04:24 AM - edited 10-26-2026 04:29 AM
Hi @Veena-EeshB,
Have you added HTML code directly into the HTML canvas or via source code?
I have implemented a document creation and it works fine for template type as HTML template. I dont see any issues. I have created HTML code and built my document template. Your script is correct too.
Edit: assign the creation of template to a variable, not related to the issue but a good practice.
var result = new sn_doc.GenerateDocumentAPI().generateDocumentForTask(recordId, documentTemplateId, pdfName);
Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2026 04:24 AM - edited 10-26-2026 04:29 AM
Hi @Veena-EeshB,
Have you added HTML code directly into the HTML canvas or via source code?
I have implemented a document creation and it works fine for template type as HTML template. I dont see any issues. I have created HTML code and built my document template. Your script is correct too.
Edit: assign the creation of template to a variable, not related to the issue but a good practice.
var result = new sn_doc.GenerateDocumentAPI().generateDocumentForTask(recordId, documentTemplateId, pdfName);
Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2026 11:31 AM
Thank you for the reply . My bad, I was coding html in html editor and not on source code. Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2026 08:27 AM - edited 10-27-2026 08:31 AM
Hi Ehab ,
I am going through another hurdle 'Document generation Api works from background script but not through HR flow or BR'. Can you please let me know your throughts
I have tested the document generation through background script -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2026 09:44 PM - edited 10-29-2026 09:44 PM
Hi @Veena-EeshB,
You can tag me so that I get notification, I have used this code which works for me
var result = new sn_doc.GenerateDocumentAPI().generateDocumentForTask(
current.getUniqueValue(), // where to attach
"b28434fd9f4bc310092d88d86924abbd", // html template
documentName // file name
);
Regards,
Ehab PIlloor