【问题标题】:Acumatica 2021 R2 Override Create Sales OrderAcumatica 2021 R2 覆盖创建销售订单
【发布时间】:2022-06-15 03:55:00
【问题描述】:

Acumatica 似乎已将 CreateSalesOrder 方法从 OpportunityMaint 移至新的 CRCreateSalesOrder 类。我不知道如何用新结构覆盖 CreateSalesOrder 方法。下面是原始代码。非常感谢任何帮助。

using PX.Data;
using PX.Objects.AR;
using PX.Objects.CM;
using PX.Objects.Common.Discount;
using PX.Objects.CR;
using PX.Objects.CR.Extensions.CRCreateSalesOrder;
using PX.Objects.CS;
using PX.Objects.IN;
using PX.Objects.PO;
using PX.Objects.SO;
using PX.Objects.TX;
using System.Collections.Generic;
using static PX.Objects.CR.OpportunityMaint;

namespace CH.KV.CPLVendorSOPO
{
    public class CHKVOpportunityMaintExt : PXGraphExtension<OpportunityMaint>
    {
        public delegate void DoCreateSalesOrderDelegate(CreateSalesOrderFilter param);
        [PXOverride]
        public void DoCreateSalesOrder(CreateSalesOrderFilter param, DoCreateSalesOrderDelegate baseMethod)
        {
            DoCreateSalesOrderCHKVExt(param);
        }

        protected virtual void DoCreateSalesOrderCHKVExt(CreateSalesOrderFilter param)
        {
            bool recalcAny = param.RecalculatePrices == true ||
                             param.RecalculateDiscounts == true ||
                             param.OverrideManualDiscounts == true ||
                             param.OverrideManualDocGroupDiscounts == true ||
                             param.OverrideManualPrices == true;

            var opportunity = Base.Opportunity.Current;
            Customer customer = (Customer)PXSelect<Customer, Where<Customer.bAccountID, Equal<Current<CROpportunity.bAccountID>>>>.Select(Base);

            //do things

            docgraph.Save.Press();
        }
    }
}

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    您还需要找到代码的移动位置。当 acumatica 将 Customer Payment Profile Maint Graph 中的一些按钮向上移动到它自己的专用类时,我不得不做类似的事情。

    这就是新的图形扩展声明的样子

    public class APSPaymentProfileHostedFormExtension : PXGraphExtension<
        CustomerPaymentMethodMaint.PaymentProfileHostedForm, 
        CustomerPaymentMethodMaint>
    {
    

    对于线索,您需要查找将在按钮最初所在的图形上声明的类似内容。就我而言,它看起来像这样。

    public class PaymentProfileHostedForm : Extensions.PaymentProfile.PaymentProfileGraph<CustomerPaymentMethodMaint, CustomerPaymentMethod>
        {
    

    希望这足以让您朝着正确的方向前进。告诉我你是怎么做出来的?

    【讨论】:

    • 谢谢罗伯特。看起来它已移至自己的扩展类(公共抽象类 CRCreateSalesOrder : PXGraphExtension where TDiscountExt : DiscountGraph, new() where TGraph : PXGraph, new( ) 其中 TMaster : 类、IBqlTable、new())。我什至不确定如何覆盖它??
    【解决方案2】:

    你有想过这个吗?我有确切的问题。

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-03
      • 1970-01-01
      • 2015-09-13
      • 1970-01-01
      • 2023-04-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多