We have an automated bot that creates sales orders and posted a payment from our online store to epicor. It works 99 percent of the time. But in the last few months, whenever the month changes, we run into this error.
Coming from this endpoint Erp.BO.CashRecSvc/CashRecs
Thing is it, it only happens when the fiscal period switches. So right now we’re switching from 5 to 6. The transaction was on 2-28 which is fiscal period 5.
I updated the code this morning thinking the issue was because it’s posting the payment a day after the transaction date. In this case posting 3/1 but the payment was on 2-28. And maybe epicor doesn’t like the transaction date 2-28 but the fiscal period being 6 instead of 5. So now the fiscal period is the same timeline as the transdate. It still pops this error.
In the past I just manually entered the payment. But then on the next fiscal period switch it will break again. Odd thing is, if I tried posting this payment tomorrow, it would probably work.
So it’s something to do with the date. Just can’t seem to figure out why. I can post the JSON of the query if need be.
Haven’t checked that yet but I think I found the cause.
Looks like the fiscalyear and fiscalperiod are not posting properly. I tested the json in pilot and I found the fiscalyear and fiscalperiod are always 0 on the epicor response side.
But if I make the same cash receipt inside epicor, and then pull down that cash receipt entry on the API side, it shows the fiscal year and period. Unsure why Epicor isn’t liking when I create an entry via the API side but that seems to be the issue as of right now.
It may be that the application is making a different server call before using the method that you are using and that the server call they are making beforehand is setting the fiscal period and year. That or something on the form is doing that.
The issue was the Transdate. It was formatted wrong. Unsure exactly why I had the formatting the way I did but after I set the formatting right, everything worked. Maybe Epicor changed something on their end? Don’t know. But I know it works now.
Entertaining part is I’m the one that wrote the code, so I don’t know why I formatted the date like this.