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

时间:2018-06-11 19:08:47

标签: customization acumatica

将GI添加到报告菜单中非常简单,但在this Technical Tuesday post中,Doug描述了自定义后需要遵循的一些其他步骤,以便将GI添加到INQUIRIES菜单中: enter image description here

有人跟着他的步骤有运气吗?我一直在使用他分享的代码获得大量验证错误,并希望得到更好的解释。

在自定义步骤之后,我们只需将其添加到Automation Step。

1 个答案:

答案 0 :(得分:0)

在我们解决技术周二职位的问题之前,请使用以下自定义代码。

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

}
相关问题