【问题标题】:How to stop adding new SOLines in Sales Orders Screen according to a condition in Acumatica如何根据 Acumatica 中的条件停止在销售订单屏幕中添加新的 SOLines
【发布时间】:2023-01-10 03:20:13
【问题描述】:

我想根据以下条件停止向销售订单添加新行阿库马提卡.我怎样才能做到这一点。?

我尝试添加以下内容。但它没有用。

protected void SOLine_RowInserting(PXCache 缓存,PXRowInsertingEventArgs e) {

        var row = (SOLine)e.Row;

        if (row == null) return;

        //Condition

        if(Condition == true)

       {

                   Base.Transaction.Delete(row);

        }

}

【问题讨论】:

    标签: customization acumatica


    【解决方案1】:

    RowSelected 事件的上下文中将 AllowInsert 缓存属性设置为 false。

    void _(Events.RowSelected<SOLine> e, PXRowSelected baseMethod)
    {
        baseMethod(e.Cache, e.Args);
    
        bool canInsertCondition = false;
        Base.Transaction.Cache.AllowInsert = canInsertCondition;
    }
    

    【讨论】:

      猜你喜欢
      • 2015-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-15
      • 2021-12-11
      • 2023-03-07
      相关资源
      最近更新 更多