Support Article
Unable to open attachments in Mobile device
SA-9991
Summary
Work Object has a section which shows a list view of attachments. On click, the attachment opens up. It works on browser, but it fails in mobile.
Error Messages
Not Applicable.
Steps to Reproduce
1. Create a section with out of the box AttachmentListView.
2. On click the configurations is to call "doAttachmentSingleClick" from the AttachmentListViewSelectorScript fragment.
3. Run the flow in Mobile and check the behaviour.
Root Cause
The DoAttachmentSingleClick has to open the attachmenet using a different API as the one existing in Mobile.
Resolution
The list view uses the AttachmentListViewSelectorScript fragment. A 'Save As' of the fragement is done with a different name and later the method "doAttachmentSingleClick" is amended with the below code:
function doAttachmentSingleClick(nRow, strClass, strInsName, strInsKey, strCategoryProp, strCategoryValue)
{
if(/Android|webOS|iPhone|iPad|iPod|IEMobile|BlackBerry/i.test(navigator.userAgent)){
window.open(serverURL + "?pyActivity=Work-.GetAttachmentReference&linkInsHandle=" + strInsKey,"_blank");
}
else if(parent.document.getElementById("ATTACHMENT-DATA"))
{
parent.document.getElementById("ATTACHMENT-DATA").src=serverURL + "?pyActivity=Work-.GetAttachmentReference&linkInsHandle=" + strInsKey;
}
else if(document.getElementById("ATTACHMENT-DATA"))
{
document.getElementById("ATTACHMENT-DATA").src=serverURL + "?pyActivity=Work-.GetAttachmentReference&linkInsHandle=" + strInsKey;
}
}
This is fixed in Pega 7.1.6 and Pega 7.1.7 releases.
Published June 12, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.