AR MisPay with GL Code through the Rest API

Hi All,

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.

Any help would be much appreciated.
Thanks!
Evan

Evan,

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).

However for an UpdateMaster you need to firstly duplicate the row so there are two rows of the exact same data like this.

CashHead[0] should have RowMod = ‘’
CashHead[1] should have RowMod = ‘A’ OR ‘U’

The transaction you are doing should now work through the REST API (assuming you followed the trace exactly).

2 Likes

This is the exact same issue someone else had. I think its the same solution for you.

That worked! I did not know that about the UpdateMaster call, but gave it a few tests and everything worked perfectly:

{
  "ds": {
    "CashHead": [
      {
        ***The Cash Head data here***
      }
    ],
    "CashHeadTGLC":  [
      {
        ***Unmodified data for entry***
      },
      {
        ***Modified data here***
      }
    ]
  },
  "ipGroupID": stuff
  ...
}

Thanks again!

Evan

1 Like

All good mate,

The same issue has come up a few times posts and I had noticed a pattern!

Good to know @jdbaur – It will not show in the trace hm.