We have used Epicor objects directly for awhile now to both print reports and edit data. We are now switching to using the REST API instead for a new project. We’ve been able to get it working successfully but are having a strange issue that we’d like to get the community’s input on.
The symptom that we’re seeing is that the SSRS report generated via a GUID returns a failure saying that “A column named ‘ResaleID’ already belongs to this table”. The odd thing is that the report was working fine before and wasn’t changed. Odder still is that we have two instances of Epicor running on our application server (Epicor and EpicorTest) and they have separate task agents, app pools, databases, etc. and they both return the same error.
This first happened last week and we tried restarting everything (task agent, app pool, regenerated data model) and finally rebooted the entire Epicor app server and nothing made it work again. We then restored the whole VM to a point before the symptoms began and it started working again. Yay!
Now this morning, it is having the same exact symptom.
A little more context:
This is the ARForm report and we use a customized version of the original. The two reports share a Data Definition and the original report still works.
A common thing that would have happened in both instances was that we tried to generate the report via the REST API using “RunDirect”. Since it’s complaining about a field already existing, my hunch would be that our REST API call is leaving a session active or not cleaning up data tables or something but I can’t make that square with the fact that both instances are failing and that a VM reboot didn’t fix it.
Any thoughts or leads would be most welcome.
Thanks,
Jim
P.S. Below is the relevant code where we call the REST API.
dynamic ds = new
{
ARInvFormParam = new List<dynamic>()
{
new
{
InvoiceNum = invoiceId,
WorkstationID = dbReportId,
AutoAction = "SSRSGenerate",
AgentSchedNum = 0,
AgentTaskNum = 0,
AgentID = "SystemTaskAgent",
ReportStyleNum = 1004,
//DraftCopy = false // this marks as printed. We are printing after generating, but this was hard to find. }
}
};
// generate report directly
await _api.BoPostAsync("Erp.RPT.ARInvFormSvc", "RunDirect", JsonConvert.SerializeObject(new { ds }));