Pega close modal dialog of Tabel layout
"pega.u.d.activeGrid.submitModal"
javascript:event
--------
Pega close modal dialog of Tabel layout
"pega.u.d.activeGrid.submitModal"
javascript:event
--------
"com.pega.pegarules.pub.services.ConnectorException"
"com.pega.pegarules.pub.services.ResourceUnavailableException"
2.1
String strFileName = tools.getParamValue("OutputFilePath");
PRFile objFile = new PRFile(strFileName); //some error checking
if(objFile.exists())
objFile.delete();
2.2
call pxGenerateExcelFile
Params - Param.FileName, WEBWB!APPRSVS!XLSX
2.3
String strFileName = tools.getParamValue("OutputFilePath");
PRFile objFile = new PRFile(strFileName); //some error checking
if (!objFile.exists())
{
attach = false;
} if(!objFile.isFile())
{
attach = false;
}
tools.putParamValue("OutputLocation",objFile.getName()); if (!objFile.canRead())
{
attach = false;
throw new PRRuntimeException("Can't continue with file upload. File \"" + strFileName + "\" is unreadable.");
} //read the file into a buffer.
java.io.DataInputStream dis = null;
byte buffer [] = null;
try
{
// dis = new java.io.DataInputStream(new java.io.FileInputStream(objFile));
dis = new java.io.DataInputStream(new PRInputStream(objFile));
buffer= new byte[dis.available()];
dis.readFully(buffer);
dis.close();
}
catch (Exception e)
{
attach = false;
throw new PRRuntimeException("Can't continue with file upload. Can't read File \"" + strFileName + "\"");
} //encode the file to Base64 so that we can store it on the database
strFileData = Base64Util.encodeToString(buffer);
if (strFileData == null)
{
attach = false;
throw new PRRuntimeException("Can't continue with file upload. Couldn't encode the file to Base64 so that we can store it on the database");
}
2.5
Page-new att (Embed-EmailAttachment)
2.6
Property-set att
.pyDecode=true
.pyData=local.strFileData
.pyName=Param.FileName
2.7 atts (Data-EmailAttachments)
Page-copy
from: att
to: atts.pyAttachments(<APPEND>)
Param.AttachmentPage=atts
Param.queueAccessGrp=Admin:AccessGroup in NewDefaults activity
https://docs-previous.pega.com/data-management-and-integration/87/configuring-rest-connector-receive-binary-attachments
Pega Platform can receive attachments regardless of the content type or response type. Configure a REST connector to receive attachments when your application connects to a service that responds with a binary stream, for example, a PDF file or XLS file.
tools.sendFile((byte[])myStepPage.getObject("Name_defined_in_response_clipboard_map_to_key "), "test.xls", false, null, true);
Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.
Want to help us improve this content?