RequestDate不更新事件我在SOLine

时间:2016-08-29 07:34:28

标签: acumatica

我刚刚在28-08-2016创建了QT,然后将businessDate更改为30-08-2016并将其复制到SOOrder,因此在复制到SOOrder之后,我再次打开QT并且状态将更改为已完成。但Soline上的RequestDate没有更新。

protected void SOOrder_Status_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
  var row = (SOOrder)e.Row;
  SOOrderExt rowExt = PXCache<SOOrder>.GetExtension<SOOrderExt>(row);

  if(row != null)
  {
    if(row.OrderType == "QT" && row.Status == "C")
    {
      rowExt.UsrRequestDate = Base.Accessinfo.BusinessDate;
    }
    else
    {
      rowExt.UsrRequestDate = row.OrderDate;
    }
  }
}

protected void SOOrder_OrderDate_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
  var row = (SOOrder)e.Row;
  SOOrderExt rowExt = PXCache<SOOrder>.GetExtension<SOOrderExt>(row);
  if(row != null)
  {
    rowExt.UsrRequestDate = row.OrderDate;
  }
}  

2 个答案:

答案 0 :(得分:0)

我认为你的问题是错误的。您已订阅 SOLINE _RowUpdated,这是有关详细信息的事件。但复制订单功能只会更新文档(SOOrder),不会触及详细信息。你应该重新考虑一下你的流程。

但实际上我的问题是 - 为什么你不使用标准逻辑(如图所示)更新请求的日期以获取详细信息? enter image description here

答案 1 :(得分:0)

protected void SOOrder_Status_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
  var row = (SOOrder)e.Row;
  SOOrderExt rowExt = PXCache<SOOrder>.GetExtension<SOOrderExt>(row);

  if(row != null)
  {
    if(row.OrderType == "QT" && row.Status == "C")
    {
      rowExt.UsrRequestDate = Base.Accessinfo.BusinessDate;
    }
    else
    {
      rowExt.UsrRequestDate = row.OrderDate;
    }
  }
}

protected void SOOrder_OrderDate_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
  var row = (SOOrder)e.Row;
  SOOrderExt rowExt = PXCache<SOOrder>.GetExtension<SOOrderExt>(row);
  if(row != null)
  {
    rowExt.UsrRequestDate = row.OrderDate;
  }
}