代码之家  ›  专栏  ›  技术社区  ›  Dane

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

  •  0
  • Dane  · 技术社区  · 7 年前

    我一直在尝试将报告下拉列表添加到套件组装屏幕(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 回复  |  直到 7 年前
        1
  •  0
  •   Dane    7 年前

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

    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
    
      }
    
    
    }