Document generation Api works from background script but not through HR flow or BR

Veena-EeshB
Tera Contributor

I have tested the document generation through background script -

var recordId = '021e42bfc348d390f52****';
var documentTemplateId = '252abf1b938***';
var pdfName = 'CFTC.pdf';
new sn_doc.GenerateDocumentAPI().generateDocumentForTask(recordId, documentTemplateId, pdfName);
 
but running this through Business rule using current.sys_id , its not generating the document at all. 
I have also tried creating the flow and using 'generate pdf document' action , and when checked the executions, it comes as completed and no errors but document is not being generated at all. I tried checking the restricted cross scope  and allowed there as well. Tried creating template and BR in global scope ,but that didnt work either. 
 
Appreciate any guidance here as I'm stuck
1 REPLY 1

Veena-EeshB
Tera Contributor

Added the flow execution screenshot