Skip to main content
Solved

Impossible to set EarningType on Employee Time Activity (Project) via API

  • July 1, 2025
  • 5 replies
  • 88 views

We’re trying to create Project time activities via API endpoint   The endpoint is custom, mapped to the Employee Time Activities screen, EP307000.

If you try and set the Earning Type to anything other than the default, the system clears the “Project Task” field, and the create/update operation fails.  This can be seen in the UI… if you change the Earning Type column in the grid, the Project Task column is unexpectedly cleared.  In the UI, you can fix it before saving.  With the API, you can’t. 

Does anybody know a workaround for this apparent bug?

Best answer by joegrist

@Abhishek Niikam ‘s answer was very close, and put me on the right track.  But ​@Dmitrii Naumov is also correct that changing the order of fields in a request has no effect.

The solution is to use 2 requests.  In. the first one, you set up everything except for the Project and Project Task.  From the response, you can grab the ID of the added row.

You can use that ID to update just that row with the Project and Project Task.  Annoying and labour-intensive, but it works!

5 replies

Forum|alt.badge.img+2

​Hello @joegrist,


When you change the Earning Type, Acumatica’s underlying business logic resets some fields — particularly the Project and Project Task — depending on the configuration of the Earning Type, employee, and project settings. In the UI, this can be corrected manually, but through the API, this logic executes silently and causes a validation error on save.

 

I think You need to set the Earning Type before setting the Project and Project Task fields in your API call. This prevents the Earning Type change from wiping out the Project Task afterward. 

{
  "Employee": { "value": "EMPLOYEEID" },
  "Date": { "value": "2025-07-02" },
  "EarningType": { "value": "OT" },        // Step 1: Set Earning Type FIRST
  "Project": { "value": "PROJ001" },       // Step 2: Set Project
  "ProjectTask": { "value": "TASK001" },   // Step 3: Set Task
  "TimeSpent": { "value": "01:00" },
  "Summary": { "value": "Worked on overtime" }
}

You must separate EarningType and ProjectTask updates in this order, or the task will be wiped out by Acumatica's field logic.

I hope it helps!


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • July 2, 2025

@Abhishek Niikam the order you send the fields in JSON does not affect the order they are processed. 

 

 

@joegrist  why do you use a custom endpoint and not the default one for that?


  • Author
  • Jr Varsity I
  • July 11, 2025

@joegrist  why do you use a custom endpoint and not the default one for that?

We’ve found that we can get faster speeds by using custom endpoints and cutting down the number of data points they deal with.  It must simplify the underlying SQL or something. 


  • Author
  • Jr Varsity I
  • Answer
  • July 11, 2025

@Abhishek Niikam ‘s answer was very close, and put me on the right track.  But ​@Dmitrii Naumov is also correct that changing the order of fields in a request has no effect.

The solution is to use 2 requests.  In. the first one, you set up everything except for the Project and Project Task.  From the response, you can grab the ID of the added row.

You can use that ID to update just that row with the Project and Project Task.  Annoying and labour-intensive, but it works!


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • July 11, 2025

Thank you for sharing your solution with the community ​@joegrist!