Acumatica - 将报告下拉列表添加到套件装配屏幕

时间:2018-03-27 17:33:24

标签: report customization acumatica

我一直在尝试将“报告”下拉列表添加到“套件组件”屏幕(IN307000)。我们有基于KitInventoryID的自定义报告,这些报告基本上会生成以打印标记,并且需要将这些报告添加到屏幕的操作中。我注意到在大多数报告屏幕中通常会有一个用于传输数据的传输,因此我在顶部编写了自己的语句。以下是我到目前为止的情况:

using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using PX.Data;
using PX.Objects.CS;
using PX.Objects.IN.Overrides.INDocumentRelease;
using PX.Objects.GL;
using PX.Objects.CM;
using System.Diagnostics;
using PX.Objects;
using PX.Objects.IN;

namespace PX.Objects.IN
{

  public class KitAssemblyEntry_Extension:PXGraphExtension<KitAssemblyEntry>
  {
  public PXSelect<INKitRegister, Where<INKitRegister.docType, Equal<Current<INKitRegister.docType>>, And<INKitRegister.kitInventoryID, Equal<Current<INKitRegister.kitInventoryID>>>>> transfer;
  public override void Initialize()
    {
        Report.AddMenuAction(MasterTag);
        Report.MenuAutoOpen = true;
    }

    #region Event Handlers

    public PXAction<INKitRegister> Report;
    [PXButton]
    [PXUIField(DisplayName = "Print Tag", MapEnableRights = PXCacheRights.Select)]
    protected void report()
    { }

    public PXAction<INKitRegister> MasterTag;
    [PXUIField(DisplayName = "Sample/Value Tag", MapEnableRights = PXCacheRights.Select)]
    [PXLookupButton]
    public virtual IEnumerable masterTag(PXAdapter adapter)
    {
      INKitRegister doc = Base.transfer.Current;
        if (doc != null)
        {
        Dictionary<string, string> parameters = new Dictionary<string, string>();
        parameters["DocType"] = this.transfer.Current.DocType;
        parameters["ItemNumber"] = this.transfer.Current.KitInventoryID.ToString();
        throw new PXReportRequiredException(parameters, "IN610004", "Sample/Value Tag");
        }

    }

    #endregion

  }


}

然而,当我尝试发布时,我收到此错误:

Building directory '\WebSiteValidationDomain\App_RuntimeCode\'.
\App_RuntimeCode\KitAssemblyEntry.cs(39): error CS1061: 'PX.Objects.IN.KitAssemblyEntry' does not contain a definition for 'transfer' and no extension method 'transfer' accepting a first argument of type 'PX.Objects.IN.KitAssemblyEntry' could be found (are you missing a using directive or an assembly reference?)
\App_RuntimeCode\KitAssemblyEntry.cs(39): error CS1061: 'PX.Objects.IN.KitAssemblyEntry' does not contain a definition for 'transfer' and no extension method 'transfer' accepting a first argument of type 'PX.Objects.IN.KitAssemblyEntry' could be found (are you missing a using directive or an assembly reference?)

我也尝试将INKitRegister doc = Base.transfer.Current;更改为INKitRegister doc = Base.Document.Current;但收到此错误:

\App_RuntimeCode\KitAssemblyEntry.cs(37): error CS0161: 'PX.Objects.IN.KitAssemblyEntry_Extension.masterTag(PX.Data.PXAdapter)': not all code paths return a value
\App_RuntimeCode\KitAssemblyEntry.cs(37): error CS0161: 'PX.Objects.IN.KitAssemblyEntry_Extension.masterTag(PX.Data.PXAdapter)': not all code paths return a value

1 个答案:

答案 0 :(得分:0)

这是固定编码,它正常工作。

using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using PX.Data;
using PX.Objects.CS;
using PX.Objects.IN.Overrides.INDocumentRelease;
using PX.Objects.GL;
using PX.Objects.CM;
using System.Diagnostics;
using PX.Objects;
using PX.Objects.IN;

namespace PX.Objects.IN
{

  public class KitAssemblyEntry_Extension:PXGraphExtension<KitAssemblyEntry>
  {
  public PXSelect<INKitRegister, Where<INKitRegister.docType, Equal<Current<INKitRegister.docType>>, And<INKitRegister.kitInventoryID, Equal<Current<INKitRegister.kitInventoryID>>>>> transfer;
  public override void Initialize()
    {
        Report.AddMenuAction(MasterTag);
        Report.MenuAutoOpen = true;
    }

    #region Event Handlers

    public PXAction<INKitRegister> Report;
    [PXButton]
    [PXUIField(DisplayName = "Print Tag", MapEnableRights = PXCacheRights.Select)]
    protected void report()
    { }

    public PXAction<INKitRegister> MasterTag;
    [PXUIField(DisplayName = "Sample/Value Tag", MapEnableRights = PXCacheRights.Select)]
    [PXLookupButton]
    public virtual IEnumerable masterTag(PXAdapter adapter)
    {
      INKitRegister doc = Base.Document.Current;
        if (doc != null)
        {
        Dictionary<string, string> parameters = new Dictionary<string, string>();
        parameters["DocType"] = this.transfer.Current.DocType;
        parameters["ItemNumber"] = this.transfer.Current.KitInventoryID.ToString();
        throw new PXReportRequiredException(parameters, "IN610004", "Sample/Value Tag");
        }
     return adapter.Get();
    }

    #endregion

  }


}