首页 文章

Acumatica - 方法覆盖错误

提问于
浏览
0

我试图覆盖现有的方法,但在我发布后,我得到了这个错误 .

尝试使用方法'Wrapper.PX.Objects.AR.Cst_ARPaymentEntry.ARPayment_RowSelectedGeneratedWrapper(PX.Objects.AR.ARPaymentEntry,PX.Data.PXCache,PX.Data.PXRowSelectedEventArgs)'来访问方法'PX.Objects.AR.ARPaymentEntry_Extension . ARPayment_RowSelected(PX.Data.PXCache,PX.Data.PXRowSelectedEventArgs)'失败 .

当我尝试删除PXOverride属性时没有发生错误 . 我正在使用5.10.072版本 .

[PXOverride]
    protected void ARPayment_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
    {

    }

1 回答

  • 4

    问题是您尝试覆盖事件处理程序 - 而不是BLC的常见虚拟方法 . 要做到这一点,必须使用不同的方法 . 也就是说,您需要声明没有 PXOverride 属性的事件处理程序,但是使用类型为 PXRowSelected 的附加参数,然后根据您的内部逻辑调用它 . 以下是此类声明的示例:

    protected void ARPayment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected invokeBaseHandler)
    {
        /* your custom event handling logic here */
    
        if(/* your custom condition may go here */)
            invokeBaseHandler(cache, e);
    
        /* some more of your logic here if needed */
    }
    

    请注意,如果您只是希望您的处理程序与基本处理程序一起执行,则不需要额外的参数 - 只需使用您的代码声明处理程序,它将在原始处理程序之后调用 .

    您可以在Acumatica的任何实例的帮助文章中找到更多关于此主题的信息和解释,这些文章位于帮助文章“功能自定义>功能自定义示例>添加或更改BLC事件处理程序”下 .

相关问题