Skip to main content
Solved

Web Service Physical Inventory failure, but no clues why

  • December 20, 2024
  • 2 replies
  • 82 views

I had to write a custom program for Physical Inventory because the Acumatica native PI stuff doesn’t work for us. Last year it worked great and everyone was very happy with it.

This year I wanted to enhance it by automatically loading the counted quantities to Acumatica over the Web Service, once counting was complete, instead of using my SQL view, exporting it to Excel and loading it into Physical Inventory Review.

 

I am having an issue though where when I upload the scans to the web service, it fails with a 500 “Operation Failed” and Inner Message “Failed to insert the PIDetail Row”. The rest is just abstract stack tracing that gives me ZERO clues of why it wouldn’t persist.

 

This happens after several hundred scans are successfully processed.

 

I started by sending batches of 500 rows of test data (last years actual PI scans) to my development server. When I got that failure, I cut the batches down to 5 and output what part/location it is working on. I then hand entered all 5 of those scans to the Acumatica UI without error. I have checked that both the InventoryItem and Warehouse Location are valid and active for each of the rows.

 

Any Ideas what could be the issue?

 

Here is a sample JSON object I’m sending in the body.

 

My program queries the web service to determine if the InventoryID/LocationID combination exists, if so it references that row by the id (GUID), other wise it creates a new row for the combination. (Sorry this is from rows my program already processed, so it only has id’s not Location/InventoryID combinations, but since these are already resolved to ID’s I think it’s safe to say that works...)

{
    "ReferenceNbr":{"value":"000030"},
    "Details":[
        {
            "PhysicalQty":{"value":"233"},
            "id":"63fcfe2a-4bbd-ef11-9657-cc96e52e6b1f"
        },{
            "PhysicalQty":{"value":"221"},
            "id":"64fcfe2a-4bbd-ef11-9657-cc96e52e6b1f"
        },{
            "PhysicalQty":{"value":"276"},
            "id":"65fcfe2a-4bbd-ef11-9657-cc96e52e6b1f"
        }
    ]
}

 

Best answer by markrice

Acumatica’s error reporting is junk.

 

I still can’t figure out why this is and we are starting inventory.

View original
Did this topic help you find an answer to your question?

2 replies

  • Author
  • Freshman III
  • 4 replies
  • December 23, 2024

For what it’s worth, here is the entire stack trace that is returned from the request:

Bad Response Error:
{#142657
  +"message": "An error has occurred."
  +"exceptionMessage": "Operation failed"
  +"exceptionType": "PX.Data.PXInvalidOperationException"
  +"stackTrace": """
       at PX.Api.ContractBased.EntityService.Put(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean throwOnError)\r\n
       at PX.Api.ContractBased.Soap.SoapFacadeBase.PutImpl(EntityImpl entity, Boolean throwOnValidationError)\r\n
       at PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)\r\n
       at lambda_method(Closure , Object , Object[] )\r\n
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n
    --- End of stack trace from previous location where exception was thrown ---\r\n
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.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 System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.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 System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.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 System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
       at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()
    """
  +"innerException": {#142672
    +"message": "An error has occurred."
    +"exceptionMessage": "The system failed to commit the PIDetail row."
    +"exceptionType": "PX.Data.PXException"
    +"stackTrace": """
         at PX.Api.SyImportProcessor.SyStep.CommitChangesInt(Object itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction, SyImportRowResult importResult)\r\n
         at PX.Api.SyImportProcessor.SyStep.CommitChanges(Object& itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction)\r\n
         at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()
      """
  }
}

 


  • Author
  • Freshman III
  • 4 replies
  • Answer
  • January 2, 2025

Acumatica’s error reporting is junk.

 

I still can’t figure out why this is and we are starting inventory.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings