Acumatica 通用查询添加到查询菜单(自动化步骤)

Acumatica Generic Inquiry Adding to Inquiries Menu (Automation Steps)

将 GI 添加到报告菜单非常简单,但在 this Technical Tuesday post 中,Doug 描述了一些额外的步骤,需要遵循这些步骤进行自定义才能将 GI 添加到 INQUIRIES 菜单:

有人跟随他的脚步走运了吗?我不断收到他分享的代码的大量验证错误,希望得到更好的解释。

自定义步骤完成后,我们只需将其添加到自动化步骤即可。

请使用以下自定义代码,直到我们在技术星期二解决问题 post。

using System;
using System.Collections;
using PX.Data;
using PX.Objects.PO;

namespace PXDemoPkg
{
    public class POOrderEntry_Extension : PXGraphExtension<POOrderEntry>
    {

        public PXAction<POOrder> inquiry;

        [PXUIField(DisplayName = "Inquiries", MapEnableRights = PXCacheRights.Select)]
        [PXButton]
        protected virtual IEnumerable Inquiry(PXAdapter adapter,
            [PXInt] [PXIntList(new int[] { 1, 2, 3 },
                               new string[] { "Vendor Details", "Activities", "PO Prepayments" })] int? inquiryID)
        {
            if (inquiryID == 3)
            {
                POOrder order = Base.Document.Current;

                string giURL = PXGenericInqGrph.INQUIRY_URL;
                string gIName = "POprepayments";
                string sParameter1Name = "POnumber";
                string sParameter1Value = order.OrderNbr;

                string url = String.Format("{0}?Name={1}&{2}={3}", giURL, gIName, sParameter1Name, sParameter1Value);

                throw new PXRedirectToUrlException(url, PXBaseRedirectException.WindowMode.New, true, "POprepayments-GI");
            }
            else
                return Base.inquiry.Press(adapter);
        }
    }

}