【发布时间】:2018-06-11 19:08:46
【问题描述】:
将 GI 添加到报告菜单很容易,但在this Technical Tuesday post Doug 中描述了一些额外的步骤,需要遵循自定义才能将 GI 添加到 INQUIRIES 菜单:
有没有人按照他的步骤走运?我在他分享的代码中不断收到很多验证错误,希望得到更好的解释。
在自定义步骤之后,我们只需将其添加到自动化步骤。
【问题讨论】:
将 GI 添加到报告菜单很容易,但在this Technical Tuesday post Doug 中描述了一些额外的步骤,需要遵循自定义才能将 GI 添加到 INQUIRIES 菜单:
有没有人按照他的步骤走运?我在他分享的代码中不断收到很多验证错误,希望得到更好的解释。
在自定义步骤之后,我们只需将其添加到自动化步骤。
【问题讨论】:
请使用下面的自定义代码,直到我们解决技术星期二帖子中的问题。
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);
}
}
}
【讨论】: