- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 02:16 AM
Hi Community,
After San diago upgrade , Ui action "Pdf Preview" is not working.
This is the code.
function previewDocument(){
var templateName = g_form.getValue('u_fulfillment_subtype');
var file = g_form.getValue('number');
var tableName = g_form.getTableName();
var templateTable = 'u_general_document_template';
var sysId = typeof rowSysId == 'undefined' || rowSysId == null ?
g_form.getUniqueValue() : rowSysId;
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new dialogClass('Preview document dialog v2');
var msg = new GwtMessage().getMessage('Edit document');
dialog.setTitle(msg);
dialog.setPreference('sysparm_sysId', sysId);
dialog.setPreference('sysparm_sourceTable', tableName);
dialog.setPreference('sysparm_templateTable', templateTable);
dialog.setPreference('sysparm_templateName', templateName);
dialog.setPreference('sysparm_fileName', file);
dialog.render();
}
I found this article . How Can use the code in my code. I tried but not working.
new GeneralHRForm(tableName, tableId, targetTableName, targetTableId).generate();
new GeneralFormAPI(fileName, targetTable, targetTableSysId);
GeneralFormAPI.SetDocument(header, footer, headerLocation, footerLocation);
GeneralFormAPI.createPDF(body);
Regards,
Harsha .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 02:21 AM
Hi,
What's the error?
Did you check the browser console?
Is the UI page an OOB one? Preview document dialog v2
Can you share the complete requirement and relevant scripts as well?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 02:49 AM
Any browser console error?
Do you have any instance in lower version to compare how it looks?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 02:56 AM - edited 10-06-2022 02:59 AM
Hi Ankur,
Browser console error - js_includes_amb.jsx?v=08-23-2022_19WebSocket connection to 'wss://123.service-now.com/amb' failed:
Do you have any instance in lower version to compare how it looks?
Yes, After clicking generate button , document will attach on HR task form in manage documents.
Regards,
harsha .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 08:06 AM
@Harsha1 did you managed to make it work? what is the content of the UI Page?