Solved

I got this error when create a check for bill through rest api

  • 26 October 2023
  • 1 reply
  • 101 views

this is the data going into the json body

{"CuryOrigDocAmt":{"value":842.32},"CashAccount":{"value":"23110"},"Type":{"value":"Check"},"Vendor":{"value":"V01652"},"CurrencyID":{"value":"USD"},"Hold":{"value":false},"PaymentAmount":{"value":842.32},"PaymentMethod":{"value":"AM EX"},"Details":[{"CashAccount":{"value":null},"PostPeriod":{"value":"092023"},"BranchID":{"value":null},"InventoryID":{"value":null},"OrderQty":{"value":0},"WarehouseID":{"value":null},"AmountPaid":{"value":842.32},"Balance":{"value":842.32},"CashDiscountBalance":{"value":null},"DocType":{"value":"Bill"},"ReferenceNbr":{"value":"126781"}}],"PostPeriod":{"value":"092023"}}

 

https://localhost//entity/Acumatica/1.0.0/Check

This is the error return from Acumatica call on

 

{"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 lambdamethod(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c\_DisplayClass6_2.<GetExecutor>b2(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":{"message":"An error has occurred.","exceptionMessage":"Exception has been thrown by the target of an invocation.","exceptionType":"System.Reflection.TargetInvocationException","stackTrace":" at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at PX.Api.ContractBased.EntityExportContextBuilder.<>c__DisplayClass91_1.<FindImplementations>b__3(PXGraph graph, EntityImpl entity, EntityImpl targetEntity)\r\n at PX.Api.SyImportProcessor.SyStep.ProcessLocateByNoteIdCommand(SyCommand cmd, SyView view, Boolean invokeCommand)\r\n at PX.Api.SyImportProcessor.SyStep.ProcessCommand(SyCommand cmd, Boolean& needCommit)\r\n at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable(CancellationToken token)","innerException":{"message":"An error has occurred.","exceptionMessage":"The 'Check' list value is not allowed for the Type field. The allowed values are: Payment, Debit Adj., Prepayment, Refund, Voided Refund, Voided Payment.","exceptionType":"PX.Data.PXSetPropertyException","stackTrace":" at PX.Objects.EndpointAdapters.ActionHelper.SetDropDownValue[Field,T](PXGraph graph, String value, Object data)\r\n at PX.Objects.EndpointAdapters.WorkflowAdapters.AP.CheckAdapter.Check_Insert(PXGraph graph, EntityImpl entity, EntityImpl targetEntity)"}}}

icon

Best answer by Vignesh Ponnusamy 26 October 2023, 18:15

View original

1 reply

Userlevel 7
Badge +4

Hi @DharmandarKumar,

I see you are using custom endpoint, what is the screen that is mapped to the Check entity?

 

From the error message, An error has occurred.","exceptionMessage":"The 'Check' list value is not allowed for the Type field, seems like you aren’t providing valid input for the Type field. You can do a GET request for existing data(of type Check) and use the Type value from it,   

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved