可以在扩展图上重写Persist()的同时调用base.Persist()方法>>

问题描述 投票:0回答:1

我正在尝试对扩展图上的Persist方法进行覆盖,以删除对原始方法的验证,但是我无法调用实际上将数据保存到扩展图中数据库中的base.Persist()方法。这是我到目前为止所得到的:

1)我创建了graphextended及其Override方法

public class POReceiptEntryExt : PXGraphExtension<POReceiptEntry>
{
    public delegate void PersistDelegate();
    [PXOverride]
    public void Persist(PersistDelegate baseMethod)
    {
        //baseMethod(); base method is commented so the base.Persist() is not actually happening
        //code without the validation I don't want here

        base.Base.Persist(); //if I add this part the code enters in a endless loop
        Base.poLinesSelection.Cache.Clear();
        Base.openOrders.Cache.Clear();
    }
}

有人可以帮我这个忙。

我正在尝试覆盖扩展图上的Persist方法,以删除对原始方法的验证,但我无法调用base.Persist()方法,该方法实际上将数据保存到数据库中……

c# acumatica acumatica-kb
1个回答
0
投票

[以下博客文章中的最后一个示例演示了如何在PXGraphExtension中调用PXGraph.Persist()来避免图形的重写Persist方法中的逻辑。

© www.soinside.com 2019 - 2024. All rights reserved.