Support Article
Not able to use Connect-File for screenshots in Pega 7.1.6
Summary
When attempting to use the Connect-File method to pull files from a work object, an error is thrown on UI.Error Messages
A valid page of class 'Data-WorkAttach-File' must be provided.Steps to Reproduce
1. Create an Activity to Browse and Open resolved work object.
2. Then, provided mechanism to invoke Connect-File for exporting the screenshot.Root Cause
A defect or configuration issue in the operating environment. The class "Data-WorkAttach-ScreenShot" is derived from "Data-WorkAttach-". The feature only consumes Data-WorkAttach-File pages as ScreenShot is not a child class of File caused the issue. Resolution
Perform the local-change: create a custom Activity with following steps to resolve the issue:
1. Open Data-WorkAttach-ScreenShot page.
2. Copy the pyEncodedScreenShot value to Data-WorkAttach-File page using below java code.
//Get the current ScreenShot Clipboard page
ClipboardPage objRefPage = tools.getStepPage();
try{
//Import the contents of an XML document onto this page.
objRefPage.adoptXMLForm(objRefPage.getProperty("pyEncodedScreenShot").toString());
}
catch(InvalidStreamError e){
oLog.infoForced("InvalidStreamException : " + e);
}
//Initialize the pyEncodedJpeg element content to the local variable
encodedJpeg = objRefPage.getProperty("pyEncodedJpeg").toString();
Note : Add the Local Paramater “encodedJpeg” of String type in activity.
3. Call Connect-File and pass Data-WorkAttach-File page.
Published January 31, 2016 - 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.