I’m still working on this API to bring nonwork hours (pto) from one database (UKG) to Kinetic. I’ve made it to the point where all of my API calls are successful, the laborhed row is added, i’ve gotten my new labordtl sequence number, etc. The issue that i’m having now is getting the labordtl row to show up.
I made sure to follow the trace. I have RowMod set to A for add in the GetNewLaborDtl call and made it blank for the final Update call (as seen by the trace). I also tried it with A or U, but both of those gave 400 errors on the update call. I even compared the laborhed update to see if I was doing something different, but they’re pretty much the same.
Any other suggestions as to what I may need to check for the labordtl row to actually show up?
not at the same time. I was saying that when i tried to change the RowMod to see if that would allow the record to show it gave 400. However, the original way (empty RowMod) gives a 200 response. The issue is that even though all the calls are successful, the LaborDtl row is not added. The laborHed row is visible, though.
it says that you cannot update or modify (depending on if rowmod is A or U) a record that has been submitted for approval. When i change the bool that enable’s submit, the error message says something like “you cannot modify/update a record that has NOT been submitted”. Go figure right?
However, when I follow the guidance given by the Trace log and leave rowmod blank, the result is 200.
We have written several integrations for this. We are using powershell to execute dmt in the background. It works great once formatting gets cleaned up.
We use UKG now as the main source of data reguarding employee time/maintenance, but our payroll is still handled through Kinetic. So, we have employees clock in through Kinetic and then batch update that data into UKG. However, employees put time off requests into UKG, so that information is being sent to kinetic for payroll purposes.
So, after some consulting with our Epicor consulted, he suggested i remove data that isnt being used until i need it. For example, when updating laborhed, remove laborDtl array. I’ve done that, but the results are still not as expected.
current status of my issue:
If i send the data with rowmod blank and a laborhedseq of 0, through an update call first, it gives a laborhedseq number. then i send it with the sequence number and rowmod set to A. This results in no change when sent through my console app. When i copy that same data into the rest help site, it does enter into my laborhed table, but with a different laborhed sequence number.
for reference:
the object was pasted into the resthelp site with “LaborHedSeq”: 605021
in my table, sequence number is 600074.
the api AND RestHelpSite both return successful (200) with the originally retrieved sequence number
I played with it a little bit but I didn’t have time to get very far.
I do however have some other pointers for you, and unfortunately you might not like it.
You are likely doing a lot of unnecessary work. You should probably not be using the REST methods directly, but should package this up in Epicor Functions, and call that from your app. It will be much easier to do, as well as maintain.
That being said…
You need to either retrieve an active LaborHed or create one.
If you create one via GetNewLaborHed, you will need to call update and
save it before it can be used.
To get your laborDtl, you will call GetNewLaborDtl, with the laborHedSeq number.
Fill out all the fields you need on it, and call update. The rowmod will be “A”, and that’s how it will come from GetNewLaborDtl.
I’m unsure of what to tell you after that because I’m not exactly clear on what all you want to do.
yes, you all have briefly mentioned to me the wonders of epicor functions. My software team does not use those, so it’ll take a bit of researching to figure out where to even start with that. In the meantime, i do need to finish this API before delving into any learning adventures.
I’ve done some playing around and I think the issue is that I was trying to input the records with a time status of already approved. However, Kinetic will not let you modify an approved record (even if that modification is adding it in the first place). As I discovered this at the end of the day yesterday, I will be testing this theory this morning.
Wish me luck!
In the meantime, if you have any references for functions within epicor, I would love to hear them. I have access to epicare and epicweb, so links from there would be awesome, if they exist.
Its not too different from what you are doing right now, but since its server side, you get to call all the methods directly without all this HTTP/networking garbage complicating things. Which also has the benefit of sending less chaff over the network.
Not only would I use Epicor functions, but then if I did have to call the 1 or 2 Epicor functions I made, I would use the RestHelper library instead of reinventing the wheel.
I’m not sure it would take too long to switch as you would be mostly just translating your Rest calls into direct BO calls. It might be worth looking at before you finish this project.