I have a custom report that is created and goes to Report Output Files. It does not go to IDM and does not create a record in DocumentObjectAndRefViews. The task, though, when the report is generated creates a record in BGTaskHistories. Here is an example:
|
11/4/2024 11:53 AM |
0 |
11/4/2024 11:52 AM |
jennifer.foster@onsightindustries.com |
0 |
0 |
0 |
0 |
ue_InstallPhotosReport_f81acc7d-ea0d-4be4-b038-71b4723bc881.pdf |
0 |
0 |
eportsue_InstallPhotosReport_f81acc7d-ea0d-4be4-b038-71b4723bc881.pdf |
Form.ue_SendInstallPhotos |
0 |
1 |
reportoutput |
0 |
29388 |
11/4/2024 11:53 AM |
|
c: eportsue_InstallPhotosReport_f81acc7d-ea0d-4be4-b038-71b4723bc881.pdf |
FORM |
jennifer.foster@onsightindustries.com |
4ad016a0-292c-4a12-abfb-84697b88a343 |
ReportServer |
11/4/2024 11:53 AM |
11/4/2024 11:52 AM |
|
|
ue_InstallPhotosReport |
ue_InstallPhotoReport |
172806 |
AllRowPointers=V(AllRowPointers) |
AllRowPointers=V(AllRowPointers) |
|
ERPSLDGRPTHMFCS |
RPT |
$service |
I have an AES event that I want to use in order to email this report as an attachment. This is what I am using to get the Task data from BGTaskHistories. I know this is working because I can get the TaskName, ReportOutputPath, etc. data.
IDO("BGTaskHistories")
PROPERTIES("ReportOutputPath,DerReportOutputFilename,FileServerPath,TaskName,TaskNumber")
DISTINCT(FALSE)
FILTER(SUBSTITUTE("TaskNumber='{0}'", V(vReportTaskNum)))SET(R(RDocResult) = RESULT)
I am then passing the FileServerPath to a variable, vFilePath, and the FileName to vReportName: SETVARVALUES(vFilePath = P(RDocResult, 1, "FileServerPath"), vReportName = P(RDocResult, 1, "DerReportOutputFilename"))
From this, I am trying to attach the report:
DOCACTION(ATTACH)
DOCNAME(V(vReportName))
DOCTYPE("PDF")
DOCMEDIATYPE("application/pdf")
SERVERNAME("ReportServer")
LOGICALFOLDERNAME("reportoutput")
FILENAME("V(vFilePath)")
ATTACHMENTNAME("InstallPhotos")
ATTACHMENTSEQ(vAttachSeq)
Despite multiple attempts, I keep getting the error: Object reference not set to an instance of an object. and the event fails. Does anyone see what I am doing wrong?