在哪里可以找到acumatica中网格动作按钮的代码

在哪里可以找到acumatica中网格动作按钮的代码,acumatica,Acumatica,我想看看grid actions按钮后面的代码。比如说,账单和调整屏幕网格部分的按钮用橙色框标记 我想看看按钮后面的代码是如何配置的。 我在哪里可以找到Acumatica网站文件夹中的文件或代码 特别是我想在“添加分包合同”按钮后面添加代码。 当您反编译PX.Objects.dll文件时,我们可以找到“添加PO”的代码。 PX.Objects.PO.GraphExtensions.APInvoiceSmartPanel.AddPOOrderExtension 但是,我需要添加分包合同的代码。按钮

我想看看grid actions按钮后面的代码。比如说,账单和调整屏幕网格部分的按钮用橙色框标记

我想看看按钮后面的代码是如何配置的。 我在哪里可以找到Acumatica网站文件夹中的文件或代码

特别是我想在“添加分包合同”按钮后面添加代码。


当您反编译PX.Objects.dll文件时,我们可以找到“添加PO”的代码。

PX.Objects.PO.GraphExtensions.APInvoiceSmartPanel.AddPOOrderExtension


但是,我需要添加分包合同的代码。按钮/操作的代码似乎来自PX.Objects.CN.Subcontracts.AP.GraphExtensions.ApInvoiceEntryAddSubcontractsExtension(PX.Objects.CN.dll)中的构造版本

相关代码片段:

[PXButton]
    [PXUIField(DisplayName = "Add Subcontracts", FieldClass = "DISTR", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
    public virtual IEnumerable addSubcontracts(PXAdapter adapter)
    {
      this.Base.checkTaxCalcMode();
      if (!this.ShouldAddSubcontracts())
        return adapter.Get();
      this.Base.updateTaxCalcMode();
      return this.addSubcontract(adapter);
    }

[PXButton]
    [PXUIField(DisplayName = "Add Subcontract", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = false)]
    public virtual IEnumerable addSubcontract(PXAdapter adapter)
    {
      return ApInvoiceEntryAddSubcontractsExtension.AddLines(new Func<PXAdapter, IEnumerable>(this.Base1.AddPOOrder2), adapter);
    }

    [PXButton]
    [PXUIField(DisplayName = "Add Subcontract Line", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
    public virtual IEnumerable addSubcontractLines(PXAdapter adapter)
    {
      this.Base.checkTaxCalcMode();
      return this.ShouldAddSubcontractLines() ? this.addSubcontractLine(adapter) : adapter.Get();
    }

    [PXButton]
    [PXUIField(DisplayName = "Add Subcontract Line", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = false)]
    public virtual IEnumerable addSubcontractLine(PXAdapter adapter)
    {
      return ApInvoiceEntryAddSubcontractsExtension.AddLines(new Func<PXAdapter, IEnumerable>(this.Base2.AddPOOrderLine2), adapter);
    }

    private static IEnumerable AddLines(
      Func<PXAdapter, IEnumerable> addLine,
      PXAdapter adapter)
    {
      try
      {
        return addLine(adapter);
      }
      catch (PXException ex) when (ex.MessageNoPrefix == "Failed to add one or more lines from the PO order. Please check the Trace for details.")
      {
        throw new Exception("SC Error: Failed to add one or more lines from the Subcontract. Please check the Trace for details.");
      }
    }
[PXButton]
[PXUIField(DisplayName=“添加分包合同”,FieldClass=“Disr”,MapEnableRights=PXCacheRights.Select,MapViewRights=PXCacheRights.Select)]
公共虚拟IEnumerable addSubcontracts(PXAdapter)
{
this.Base.checkTaxCalcMode();
如果(!this.ShouldAddSubcontracts())
返回适配器Get();
this.Base.updateTaxCalcMode();
返回此.addSubcontract(适配器);
}
[按钮]
[PXUIField(DisplayName=“添加分包合同”,MapEnableRights=PXCacheRights.Select,MapViewRights=PXCacheRights.Select,Visible=false)]
公共虚拟IEnumerable适配器(PXAdapter)
{
返回ApInvoiceEntryAddSubcontractsExtension.AddLines(新Func(this.Base1.AddPOOrder2),adapter);
}
[按钮]
[PXUIField(DisplayName=“添加分包合同行”,MapEnableRights=PXCacheRights.Select,MapViewRights=PXCacheRights.Select)]
公共虚拟IEnumerable addSubcontractLines(PXAdapter适配器)
{
this.Base.checkTaxCalcMode();
返回此.ShouldAddSubcontractLines()?此.addSubcontractLine(适配器):adapter.Get();
}
[按钮]
[PXUIField(DisplayName=“添加分包行”,MapEnableRights=PXCacheRights.Select,MapViewRights=PXCacheRights.Select,Visible=false)]
公共虚拟IEnumerable addSubcontractLine(PXAdapter适配器)
{
返回ApInvoiceEntryAddSubcontractsExtension.AddLines(新Func(this.Base2.AddPOOrderLine2),adapter);
}
私有静态IEnumerable addline(
Func addLine,
PX适配器(适配器)
{
尝试
{
返回addLine(适配器);
}
当(ex.MessageNoPrefix==“未能从采购订单中添加一行或多行。请检查跟踪以了解详细信息”)时捕获(PXException ex)
{
抛出新异常(“SC错误:未能从分包合同中添加一行或多行。请检查跟踪以了解详细信息”);
}
}
查看这段代码,我们可以看到它将使用PX.Objects.PO.GraphExtensions.APInvoiceSmartPanel.AddPOOrderExtension中的AddPOOrder2

此代码可在Acumatica的源代码中找到,如下所示:

[PXUIField(DisplayName = Messages.AddPOOrder, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = false)]
        [PXLookupButton]
        [APMigrationModeDependentActionRestriction(
            restrictInMigrationMode: true,
            restrictForRegularDocumentInMigrationMode: true,
            restrictForUnreleasedMigratedDocumentInNormalMode: true)]
        public virtual IEnumerable AddPOOrder2(PXAdapter adapter)
        {
            bool isInvoice = (Base.Document.Current.DocType == APDocType.Invoice),
                isPrepayment = (Base.Document.Current.DocType == APDocType.Prepayment);
            if (Base.Document.Current != null &&
                isInvoice &&
                Base.Document.Current.Released == false &&
                Base.Document.Current.Prebooked == false)
            {
                List<POOrder> orders = poorderslist.Cache.Updated.RowCast<POOrder>().Where(rc => rc.Selected == true).ToList();
                foreach (POOrder rc in orders)
                {
                    Base.InvoicePOOrder(rc, false);
                }
                Base.AttachPrepayment(orders);
            }
            return adapter.Get();
        }
[PXUIField(DisplayName=Messages.AddPOOrder,MapEnableRights=PXCacheRights.Select,MapViewRights=PXCacheRights.Select,Visible=false)]
[查看按钮]
[APMigrationModeDependentActionRestriction](
restrictInMigrationMode:true,
restrictForRegularDocumentInMigrationMode:true,
限制未释放的迁移文档正常模式:true)]
公共虚拟IEnumerable AddPOOrder2(PXAdapter适配器)
{
bool isInvoice=(Base.Document.Current.DocType==APDocType.Invoice),
ispReturnation=(Base.Document.Current.DocType==APDocType.predured);
如果(Base.Document.Current!=null&&
幻觉&&
Base.Document.Current.Released==false&&
Base.Document.Current.prebook==false)
{
List orders=poorderslist.Cache.Updated.RowCast().Where(rc=>rc.Selected==true.ToList();
foreach(订单中的订单数量)
{
基本发票订单(rc,假);
}
基础。附件预付款(订单);
}
返回适配器Get();
}
这里的基本调用是指
APInvoiceEntry