I’m looking for a way to automate emailing a Trial Balance Report as a way to verify that the “printing” is working for the SSRS connector. Currently, every time we restart the server we are manually going into Epicor and doing a print preview of the Trial Balance Report to verify that it is working. I’m working to automate all checks for all applications that we utilize through a Powershell script so it isn’t as manual of a process, especially after Server Updates. I’m not sure that this is even the best way to verify the “printing”, it is just what we have been doing. I also have little to no Epicor experience as I’m Infrastructure/ Cybersecurity, but I’m the one making the script. Any help is greatly appreciated. (Side note: We are upgrading to Kinetic in the next few months so preferably a solution that also works for that)
If just testing if printing is working, I use the Book Listing, which is what the Epicor Cloud Team usually does when they test if printing is working. There’s no sensitive data on it and it runs quickly.
From PowerShell, I would use Invoke-Restmethod and POST to the Erp.RPT.GlBookReportSvc.SubmitToAgent method. Using REST will work on 10.2.500 and up. @jtownsend recently did a post from C# that shows the data structures required.
Since you’re also in Cybersecurity, you can use PowerShell’s Secret Management modules to not embed any credentials in your script.
There are REST guides up on EpicWeb with examples:
My recent post was regarding custom BAQ Reports from a custom form. Pulling a canned report looks simpler, but I’ll also admit most of my REST experience involves making calls out from ERP rather than into. Still, I’m fairly certain you’ll need to hit these objects:
Ice.BO.SysAgentSvc/GetDefaultTaskAgentID - Get AgentID for submitting the report.
Erp.RPT.GlBookReportSvc/GetNewParameters - Get Defaults for specific report. Note this isn’t necessarily everything you need to run the report. It may pull blank fields you’ll have to populate before submitting. Run a trace with full details when running the report from the UI to see what’s needed.
Erp.RPT.GlBookReportSvc/SubmitToAgent - Submit report run request to agent using AgentID and parameters from above.
/Ice.BO.SysMonitorTasksSvc/List - Get submitted tasks to see if your report was submitted, and if it was, current status.
Forgot to mention that one can also use the Swagger page to see the required objects and to test manually. Again, details in the REST guides.