I’m working on creating Cash Receipts through the Rest API that are MisPay and that have a GL account associated but can’t quite figure out how:
I’ve tried Erp.BO.CashRecSvc/CreateNewCashHeadTGLC, Erp.BO.CashRecSvc/CashHeadTGLCs, and Erp.BO.CashRecSvc/UpdateMaster but can’t seem to get these to create WITH a GL code associated.
Also, I’ve done a trace and that wasn’t very helpful. It simply calls the PreUpdate and UpdateMaster methods on CashRec but invoking these through the API doesn’t seem to do the trick.
Possible Issue
I am just throwing this out there because I have seen it before and this may be the source of your issue… (I dont have time to test this use case in my test system to confirm).
A common problem across the REST api and it is almost everywhere I have seen ‘UpdateMaster’ is that the Epicor application must be doing some sort of comparison between a copy of the transaction stored somewhere in the application UI and the current row being updated (I speculate as I do not work for Epicor).
This does not show on any trace log, therefore when you reproduce through the REST api you get errors or the update does not occur, this is because whatever is happening behind the curtain is throwing a null exception error, as it would have no row to compare to, thus the try catch loop fails with null exception error and for you the developer you just get a vague message and assume its something you are doing wrong (I have got some really wierd ones on this bug).
How to fix
I have gone to the REST api and I am just using a blank dataset to show you what to do.
I assume you are creating a ‘CashHead’ but this example would work with any of the other ones (CashHeadTGLC etc etc).
In your API transaction based off your trace you are sending through the row to update or create to the Update master method like so. This row would be RowMod = “A” or “U” (Add / Update).