REST Deleting Approved Paid Time off with dotnet core

Im attempting to delete a paid time off request from kinetic when it is deleted in another system. I have followed the trace and all calls report successful. However, the records are still in LaborHed and LaborDtl tables.

The trace suggests sending an update with the LaborDtl record completely removed and changed the hours in the laborhed record. However, In EpicCare, i found an article that suggested changing the rowmod value to D. This produced the following error with a 400 code. Anyone have any idea what could be preventing the record from actually being removed?

Invalid to delete an approved labor detail

After some digging in swagger, I discovered a DeleteByID method that asks for the laborhed sequence and is successful at deleting the record. Now my question is, what would be some repercussions of using this endpoint instead of Update (as suggested by trace)?

I’m in a similar situation here. I am attempting to create an access form that will allow supervisors to edit/delete labor entries for their subordinates. I’ve performed a trace that results in:

  1. ValidateProjectClosed
  2. RecallFromApproval
    — submits with TimeStatus, TreeNodeImagName, and AppointmentTitle changed from approved to entered.
  3. CheckNonconformance
  4. Update
    — here it has the record to be deleted completely removed from the data set.

Unfortunately, no matter what I do, I have not been able to bypass the error of “unable to delete an approved record”. Help!

I dealt with this sometime in the last 6 months or so and was able to get past this. Much different scenario in my case, we sometimes need to reverse production reporting against a job. You’re pretty close but possibly missing one crucial step.

  1. ValidateProjectClosed
  2. For every LaborDtl record you want to delete, set the RowMod to U
  3. RecallFromApproval
  4. For every LaborDtl record you want to delete, set the RowMod to D
  5. Update

And note that you can only recall the record if the labor hasn’t been posted via Capture WIP. Since that’s now a journal entry, it follows the rules of all journaling systems:

Once you post, you’re toast.

2 Likes

Unfortunately setting Rowmod to U for recall (200 response), then to D for update has not produced results. Though it is slightly different phrasing , it’s still the same error basically.

 "Approved time record.  Cannot Delete."

I tried setting the rowmod to U for recall and then removing the record from the dataset and it produced a 200 result, but the record still exists in laborhed. Also, I did already check, it says WIPPosted is false. I’m assuming that’s the indicator of the “Capture WIP” reference @Mark_Wonsil

1 Like

You might have two updates like @afrank says. One to Recall the time and then one for the delete.

Yes, so currently I set rowmod to U for the recall method and then change it to D for the update call. Are you saying to send the update as U to actually update the record as not approved yet and then change rowmod to D and resubmit?

1 Like

I might break the problem up into two:

  • Make sure you can recall approved time
  • Delete unapproved time

That way we can see where the hang up is. Based on the error message, it sounds like it’s not being recalled correctly.

1 Like

RecallFromApproval has an output parameter cMessageText - might be worthwhile to see what that says (if anything).

I am only calling Update once. Based on the most recent error, I’m inclined to believe that the RecallFromApproval is not doing anything. Yes it’s giving you a 200 response, but that doesn’t mean it actually did the recall.

I would suggest bringing up the record you’re working with in the Time and Expense screen (I’m assuming that record is in “Approved” status) and call just RecallFromApproval. Then refresh the UI and see if the status of that record is any different.

2 Likes

the cMessageText was returning an empty string. I was able to get it to work by submitting an update with rowmod set to U after recall from approval. This call also made sure the fields i mentioned earlier were changed from approved to entered. Then I changed rowmod to “D” and resubmit. Eureka! Thanks everyone for your help!

2 Likes