461 views

Description

Print Friendly Version feature does not work when an attachment is present against a record.

 

Steps to Reproduce

 

  1. Navigate to an open Incident record that does not have an attachment.

  2. Click the gear icon in the upper right and select the Printer Friendly feature in the system settings.

    It should display ok.

  3. Attach a file to the Incident record and repeat step 2.

    The code shown in Customer visible description is displayed at the bottom of the page.

Workaround

A permanent fix for this issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In field to determine whether any versions have a permanent fix.

To work around this issue, print a subset of the page:

  1. Go to the record that needs to be printed.

    For example, use the ticket from the Steps to Reproduce procedure.

  2. Click the gear icon in the upper right and select the Printer Friendly feature in the system settings.

  3. Highlight the text that needs to be printed.

    Leave out the text that is the result from the issue.

  4. Right-click on the highlighted text and select Print.

    Only the highlighted area will be printed.

You can also try this programmatic workaround, which has been tested against incidents and tasks.

The print preview contains code at the bottom related to an addLoadEvent function call, such as:

addLoadEvent(function() { var elementID = "5512779cdb2c8b00511d5cb3dc961997" var elm = $(elementID); elm.inPlaceEdit({ selectOnStart: true, turnClickEditingOff: true, onBeforeEdit: function() { elm.lastAriaLabel = elm.getAttribute("aria-label"); elm.removeAttribute("aria-label"); elm.setAttribute("role", "textbox"); }, onEditCancelled: function() { elm.removeAttribute("role"); if (elm.lastAriaLabel) { elm.setAttribute("aria-label", elm.lastAriaLabel); } }, onAfterEdit: function(newName) { var oldName = this.oldValue; var ga = new GlideAjax('AttachmentAjax'); ga.addParam('sysparm_type', 'rename'); ga.addParam('sysparm_value', 'b702379cdb2c8b00511d5cb3dc96199e'); ga.addParam('sysparm_name', newName); ga.getXML(function(response) { var answer = response.responseXML.documentElement.getAttribute("answer"); if (answer !== '0') alert(new GwtMessage().getMessage("Renaming attachment {0} to new name {1} is not allowed", oldName, newName)); $$('a[data-id="b702379cdb2c8b00511d5cb3dc96199e"]').each(function(elem){ elem.innerHTML = (answer === '0') ? newName : oldName; }); $$('span[data-id="b702379cdb2c8b00511d5cb3dc96199e"]').each(function(el){ el.innerHTML = (answer === '0') ? newName : oldName; }); getMessage(["Download {0}", "View {0}", "Rename {0}"], function(msg) { var id = 'b702379cdb2c8b00511d5cb3dc96199e'; var newDownloadText = new GwtMessage().format(msg["Download {0}"], newName); var newViewText = new GwtMessage().format(msg["View {0}"], newName); var newRenameText = new GwtMessage().format(msg["Rename {0}"], newName); $$('a[data-id="' + id + '"]').each(function(elem){ elem.setAttribute("aria-label", newDownloadText); }) $$('.view_' + id).each(function(elem){ elem.setAttribute("aria-label", newViewText); }) $$('.rename_' + id).each(function(elem){ elem.setAttribute("aria-label", newRenameText); }) }) elm.removeAttribute("role"); }); } }); });


Related Problem: PRB1114743

Seen In

There is no data to report.

Intended Fix Version

London

Fixed In

Jakarta Patch 7
Kingston Patch 1

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-07 10:43:16
Published:2017-11-08