Call sn_pdfgeneratorutils.PDFGenerationAPI in UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 09:40 AM
Hi All,
I want to generate pdf from custom table fields I am using sn_pdfgeneratorutils.PDFGenerationAPI and I am working on the scoped application.
I tested sample code from docs in a fixed script, and it worked fine but when I try to use it in UI action it gives the error, catch block as 'sn_pdfgeneratorutils not defined'.
Please suggest what would be correct way for using this in UI action.
Thanks in advance!
Please find the script used in the UI action below:
function testf() {
alert("1");
var fieldMap = new Object();
fieldMap["APPLICATION NO"] = "123456";
alert("2");
var flatten = new Object();
flatten["FlattenType"] = "partially_flatten";
alert("3");
try {
var v = new sn_pdfgeneratorutils.PDFGenerationAPI;
alert("4");
} catch (e) {
alert("Error Output##1 :" + e);
}
var result = v.fillDocumentFieldsAndFlatten(fieldMap, "aa74a0f497213110e2b8337e6253afc4", "incident", "57af7aec73d423002728660c4cf6a71c", "pdfName", flatten);
gs.info(JSON.stringify(result));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 09:49 AM
@garimadubey can you please check once using pageSize before your pdf generator function if this helps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 02:33 AM
Hi have the same issue! It runs on UI Action but not in Flow Designer...
Did you solve it?