通过API的ReleasePayment导致PX.Data.PXActionDisabledException

问题描述

当尝试通过Web服务端点〜/ entity / Default / 18.200.001 / Payment / ReleasePayment释放客户退款(AR302000)时,我收到以下异常消息:

{
    "message": "An error has occurred.","exceptionMessage": "Operation failed","exceptionType": "PX.Data.PXInvalidOperationException","stackTrace": "   at PX.Api.ContractBased.EntityService.Invoke(ISystemContract systemContract,String version,String name,EntityImpl entity,ActionImpl action,CbOperationContext operationContext,Boolean throwOnError)\r\n   at PX.Api.ContractBased.Soap.SoapFacadeBase.InvokeImpl(EntityImpl entity,Boolean throwOnError)\r\n   at PX.Api.ContractBased.SystemContracts.V2.SoapFacade.PX.Api.ContractBased.IRestGate.Invoke(EntityImpl entity,String objectName,HttpRequestMessage request)\r\n   at PX.Api.ContractBased.SystemContracts.V2.RestController.InvokeAction(String objectName,String actionName,ActionInvocation invocation)\r\n   at lambda_method(Closure,Object,Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_1.<GetExecutor>b__3(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": "The Release button is disabled.","exceptionType": "PX.Data.PXActionDisabledException","stackTrace": "   at PX.Data.PXAction`1.<Press>d__28.MoveNext()\r\n   at PX.Api.SyImportProcessor.SyStep.a(Object A_0,PXFilterRow[] A_1,PXFilterRow[] A_2)\r\n   at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()"
    }
}

请求正文如下:

{
   "entity": {
      "ReferenceNbr": {
        "value": "FTNHQ-RP0205826"
      }
   }
}

在查看付款单据时,我已经检查了释放按钮的启用:

Customer Refund

从2019R1(19.100.0122)升级到2020R1(20.108.0019)之后,此端点以及/ Invoice / ReleaseInvoice上的错误开始发生。请注意,我可以做其他的创建,读取和更新工作-似乎只是动作引起问题,例如我要在此发布的客户退款是通过API创建的。

起初,我认为这可能与2019R2中推出的控制帐户限制的新功能有关,但我确保在科目表列表中设置子分类账设置。

我还使用事件探查器检查了跟踪请求,但无法从列表中解密可操作的任何内容,请参见下文。

Trace for ~/entity/default/18.200.001/payment/releasepayment

PS。我仍然可以在生产服务器上(通过Web服务API)运行上述发行操作,而不会出现任何问题(因为它仍在版本2019R1中)。

我还试图通过Web上的常规UI释放客户退款,并且这种方式行之有效,所以这肯定有点让人头疼。

我们将不胜感激任何帮助/想法。

上面的屏幕快照中的长跟踪消息:

LINQ fallback! Consider rewriting your query.    at Remotion.Linq.Clauses.StreamedData.StreamedSequenceInfo.ExecuteQueryModel(QueryModel queryModel,IQueryExecutor executor)
   at Remotion.Linq.QueryProviderBase.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
   at Remotion.Linq.QueryableBase`1.GetEnumerator()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.<DistinctIterator>d__64`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at PX.Objects.GL.FinPeriodIDAttribute.ValidateRelatedToMainFinPeriods(PXCache cache,Object oldRow,Object newRow,Boolean externalCall,Nullable`1 newMainCalendarOrgID,Nullable`1 oldMainCalendarOrgID,FinPeriod newMainOrgFinPeriod)
   at PX.Objects.GL.FinPeriodIDAttribute.ValidatePeriodAndSourcesImpl(PXCache cache,Boolean externalCall)
   at PX.Objects.GL.OrganizationDependedPeriodIDAttribute.RowPersisting(PXCache sender,PXRowPersistingEventArgs e)
   at PX.Objects.GL.OpenPeriodAttribute.RowPersisting(PXCache sender,PXRowPersistingEventArgs e)
   at PX.Data.PXRowPersisting.Invoke(PXCache sender,PXRowPersistingEventArgs e)
   at PX.Data.PXCache.OnRowPersisting(Object item,PXDBOperation operation)
   at PX.Data.PXCache`1.PersistInserted(Object row,Boolean bypassInterceptor)
   at PX.Data.PXCache`1.Persist(PXDBOperation operation)
   at PX.Data.PXGraph.Persist(Type cacheType,PXDBOperation operation)
   at PX.Data.PXGraph.Persist()
   at PX.Objects.AR.ARPaymentEntry.Persist()
   at PX.Data.PXSave`1.<Handler>d__2.MoveNext()
   at PX.Data.PXAction`1.<Press>d__28.MoveNext()
   at PX.Api.SyImportProcessor.SyStep.a(Object A_0,PXFilterRow[] A_2)
   at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()
   at PX.Api.ContractBased.EntityService.Invoke(ISystemContract systemContract,Boolean throwOnError)
   at PX.Api.ContractBased.Soap.SoapFacadeBase.InvokeImpl(EntityImpl entity,Boolean throwOnError)
   at PX.Api.ContractBased.SystemContracts.V2.SoapFacade.PX.Api.ContractBased.IRestGate.Invoke(EntityImpl entity,HttpRequestMessage request)
   at PX.Api.ContractBased.SystemContracts.V2.RestController.InvokeAction(String objectName,ActionInvocation invocation)
   at lambda_method(Closure,Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_1.<GetExecutor>b__3(Object instance,Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext,CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore(HttpActionContext actionContext,CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsync(HttpActionContext actionContext,CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ActionFilterResult.<>c.<ExecuteAsync>b__5_0(ActionInvoker innerInvoker)
   at System.Web.Http.Controllers.ActionFilterResult.<>c__DisplayClass7_0`1.<InvokeActionWithActionFilters>b__0()
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecutedAsync(HttpActionContext actionContext,CancellationToken cancellationToken,Func`1 continuation)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Filters.ActionFilterAttribute.ExecuteActionFilterAsyncCore(HttpActionContext actionContext,Func`1 continuation)
   at System.Web.Http.Filters.ActionFilterAttribute.System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync(HttpActionContext actionContext,Func`1 continuation)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecutedAsync(HttpActionContext actionContext,Func`1 continuation)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync(CancellationToken cancellationToken)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.ExecuteAuthorizationFilterAsyncCore(HttpActionContext actionContext,Func`1 continuation)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.System.Web.Http.Filters.IAuthorizationFilter.ExecuteAuthorizationFilterAsync(HttpActionContext actionContext,Func`1 continuation)
   at System.Web.Http.Controllers.AuthorizationFilterResult.ExecuteAsync(CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Controllers.ExceptionFilterResult.ExecuteAsync(CancellationToken cancellationToken)
   at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext,CancellationToken cancellationToken)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)
   at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)
   at Autofac.Integration.WebApi.Owin.DependencyScopeHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)
   at System.Web.Http.HttpServer.<SendAsync>d__24.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)
   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__20.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Owin.HttpMessageHandlerAdapter.InvokeCore(IOwinContext context,IOwinRequest owinRequest,IOwinResponse owinResponse)
   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__20.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Owin.HttpMessageHandlerAdapter.InvokeCore(IOwinContext context,IOwinResponse owinResponse)
   at PX.Owin.Startup.<<ConfigurationImpl>b__10_5>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at PX.Owin.Startup.<ConfigurationImpl>b__10_5(IOwinContext ctx,Func`1 next)
   at PX.Logging.Enrichers.OwinExtensions.<>c.<<DisableAspNetCallbackEnricher>b__0_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at PX.Logging.Enrichers.OwinExtensions.<>c.<DisableAspNetCallbackEnricher>b__0_0(IOwinContext ctx,Func`1 next)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.<Invoke>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Mapping.MapWhenMiddleware.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.<RunApp>d__7.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.RunApp(Func`2 entryPoint,IDictionary`2 environment,TaskCompletionSource`1 tcs,StageAsyncResult result)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent(Object sender,EventArgs e,AsyncCallback cb,Object extradata)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously)
   at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
   at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context,AsyncCallback cb)
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext context)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer,IntPtr nativeRequestContext,IntPtr moduleData,Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer,Int32 flags)
   at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler,RequestNotificationStatus& notificationStatus)
   at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler,RequestNotificationStatus& notificationStatus)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer,Int32 flags)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)