是否可以在 Graph Extended 上覆盖 Persist() 时调用方法 base.Persist()
is it possible to call the method base.Persist() while doing the override of the Persist() on a Graph Extended
我正在尝试覆盖扩展图上的 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();
}
}
谁能帮我解决这个问题。
以下博客中的最后一个示例 post 演示了如何在 PXGraphExtension 中调用 PXGraph.Persist() 以避免图形的覆盖 Persist 方法中的逻辑。
https://asiablog.acumatica.com/2017/02/override-static-method.html
如博客中所述 post - 除非必要,否则应避免使用此方法。
我正在尝试覆盖扩展图上的 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();
}
}
谁能帮我解决这个问题。
以下博客中的最后一个示例 post 演示了如何在 PXGraphExtension 中调用 PXGraph.Persist() 以避免图形的覆盖 Persist 方法中的逻辑。
https://asiablog.acumatica.com/2017/02/override-static-method.html
如博客中所述 post - 除非必要,否则应避免使用此方法。