Automate the Server File Download process?

We have an external BAQ that needs to be generated nightly and transmitted to one of our suppliers. We use a Python program for processing and initiating the FTP process that lives on our local server.

Since we have a 3rd party host for Epicor, the nightly BAQ Export Process saves the file to the remote Epicor server. I just need to find a way to automate the copying of the file over to our local server.

Any suggestions?

Enable tracing, and pull down the file manually.

Then go back through the trace log and see what BO’s are called, and maybe you can make a BPM (or Epicor function?) that simulates the download.

Or make a BAQ report setup to email it nightly. Have the receiving mail client extract the attachment and save it to where your Python program expects it to be.

Mr. Todd: Could you use Excel and an OData connection (or other OData program) to the BAQ to get the data in Excel.

Then you can macro the information anywhere you like.

DaveO

TBH, I would just call the BAQ through the REST service.

https://{server}/{instance}/api/v1/BaqSvc/{BAQName}?{param1}=‘2016-12-01’

Run it in PowerShell right from your FTP machine at the time of your choosing and save the file there. If you use the v2 REST calls, create an API-KEY and Access Scope that can run only this BAQ. This allows you to use a Username with no password expiry. If you set up your script to get the API from a vault of some kind, you can then roll the API key periodically without changing the code.

You could even call the REST endpoint and do the whole thing in Python but I like breaking out steps to see where things get hung up instead of trying to figure out what’s going on in that black-box. This is especially nice to those who have to fix this when the authors are not available.

2 Likes