【问题标题】:Acumatica Custom DAC not triggering Business eventsAcumatica 自定义 DAC 未触发业务事件
【发布时间】:2021-06-30 09:12:18
【问题描述】:

美好的一天

这里有一些背景:

首先创建了一个视图来将所有客户的余额分组到分支机构:

CREATE VIEW CustomerBalance AS
select CustomerID,  sum(CurrentBal) AS 'CurrentBal'
from ARBalances
group by CustomerID;

此后,我将视图拉入自定义,Acumatica 为我制作了这个 DAC:

using System;
using PX.Data;

namespace JVDCustomerCreditLimit
{
  [Serializable]
  [PXCacheName("CustomerBalance")]
  public class CustomerBalance : IBqlTable
  {
    #region CustomerID
    [PXDBInt(IsKey = true)] // Added IsKey not sure if i should have...
    [PXUIField(DisplayName = "Customer ID")]
    public virtual int? CustomerID { get; set; }
    public abstract class customerID : PX.Data.BQL.BqlInt.Field<customerID> { }
    #endregion

    #region CurrentBal
    [PXDBDecimal()]
    [PXUIField(DisplayName = "Current Bal")]
    public virtual Decimal? CurrentBal { get; set; }
    public abstract class currentBal : PX.Data.BQL.BqlDecimal.Field<currentBal> { }
    #endregion
  }
}

通过以上,我制作了一个 GI 链接到客户主数据中以获得信用额度

问题来了:

我创建了一个查找 GI 更改的业务事件。 Business 事件在我更新信用额度(BAccount) 时触发,但在 CurrentBalDAC(View) 更改时不会触发。

我在 DAC 的代码中遗漏了什么,以便在发生更改时触发业务事件?

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    我怀疑问题在于您使用 SQL 视图将数据驱动到 GI。不会检测到更改,因为它将是其他实体正在接收实际更改。

    【讨论】:

    • 嗨罗伯特,我也是这么想的。您知道可以在 DAC 上使用的一种属性来告诉 Acumatica 查找/检查更改吗?
    • 我不是 100% 确定它会起作用,但您可以查看一个 PXProjection 来聚合这些值。如果这无济于事,您可能能够在附属细节上绑定一些东西,该细节将汇总一个值并将其发布到您想要将 GI 连接到的记录中。这应该反过来做一个适当的触发器来发出你的通知。我很想知道这是如何展开以及最终如何解决的。
    猜你喜欢
    • 2019-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-15
    • 1970-01-01
    • 1970-01-01
    • 2012-10-08
    • 2018-01-12
    相关资源
    最近更新 更多