Skip to main content
Answer

Using REST API to update production order operations

  • September 8, 2025
  • 4 replies
  • 92 views

My task: Update two custom fields in the operation record named JBStartDate and JBEndDate

The Process: programmatically put the production order on hold, update the operations, release the production order from hold.

Accomplished: put the production order on hold and release the production order from hold

Error encountered: updating the operation record (specifically the custom fields JBStartDate and JBEndDate)

JSON: {

"OrderType" :  {

"value": "RO"

 },

"ProductionNbr" : {

"value" : "MFG000007-000"

 },

 

"Operations" : [

{"id" : "c24f0a14-d742-f011-8429-129114ee79ef", "JBStartDate" : { "value" : "2025-10-16T13:24:51Z"}, "JBEndDate" : { "value" : "2025-10-22T11:26:39Z"} },{"id" : "c64f0a14-d742-f011-8429-129114ee79ef", "JBStartDate" : { "value" : "2025-10-22T11:26:40Z"}, "JBEndDate" : { "value" : "2025-10-23T11:57:16Z"} },{"id" : "ca4f0a14-d742-f011-8429-129114ee79ef", "JBStartDate" : { "value" : "2025-10-23T11:57:17Z"}, "JBEndDate" : { "value" : "2025-10-29T07:14:05Z"} }]}

Error Message returned (the highlighed part is my highlight because I don’t understand why it would be complaining about reports when I am not invoking reports): {"message":"An error has occurred.","exceptionMessage":"Non-report (type T) entity ProductionOrderDetail cannot be used for reports","exceptionType":"PX.Api.ContractBased.NonReportEntityCannotBeUsedAsReportException","stackTrace":"   at PX.Api.ContractBased.ReportService.StartReport(ISystemContract systemContract, String name, String version, EntityImpl entity, String locale, CbOperationContext operationContext)\r\n   at PX.Api.ContractBased.AspNetCore.CbEndpointFeatureServiceExtensions.StartReport(IReportService reportService, ICbEndpointFeature feature, EntityImpl parameters, String locale, CbOperationContext operationContext)\r\n   at PX.Api.ContractBased.WebApi.Controllers.ReportController.StartReport(String objectName, EntityImpl parameters)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()"} 

 

I would be grateful for any insight that you can provide.

Thanks!

Alan

Best answer by alandgates

Update on this. I was using a POST and should have been using a PUT.  It works perfectly now!

4 replies

  • Author
  • Freshman II
  • Answer
  • September 9, 2025

Update on this. I was using a POST and should have been using a PUT.  It works perfectly now!


Alan,

Great that you were able to get it to work. I’ve run into the PUT vs. POST issue a couple of times as well.

For the Operation update, which endpoint are you using in your calls? We’ve been really struggling with trying to create Production Orders with fully custom Operations and Materials. Every time we try to use an endpoint and provide an Operation collection, it gets grumpy.

We can create ProductionOrders if the Stock Item has a BOM, but for Stock Items where we want a custom series of Operations and Materials, we just can’t get any of the API endpoints to cooperate and I’d rather not build out a custom extension if there’s one that already works.

Thanks for any info you can provide.

Jeff


  • Author
  • Freshman II
  • September 9, 2025

Jeff,

Unfortunately, I think I will be of no help here. Our integrator created a custom endpoint to production order detail and asked me to use that: BaseURL+entity/StandLockMFG/24.200.001.001/ProductionOrderDetail.  Also, to make it work, I have to put the production order on hold before doing the operation update or Acumatica will reject the update.  So the process is: Put on hold, update the ops, release the hold.

Alan


Alan,

Thanks - I’m thinking in the absence of any specific Manufacturing endpoint documentation, I may just have to bite the bullet and extend and endpoint. Thanks for the response and good luck with your project.

Jeff