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