我们正在使用“运行项目开票”屏幕在AR /发票和备忘录中创建记录 .
在Invoice&Memo屏幕中,我们需要填充 Headers Customer Ord的过程 . number,以及已添加到“文档详细信息”选项卡上的网格部分的用户字段 . 目前,这个过程并没有这样做 .
我想使用我熟悉的技术拦截屏幕上的处理操作,即使用'AddHandler':
[PXOverride]
protected virtual IEnumerable Items (PXAdapter adapter)
{
PXGraph.InstanceCreated.AddHandler<BillingProcess>((graph) =>
{
graph.RowInserting.AddHandler<BillingProcess.ProjectsList>((sender, e) =>
{
//Custom logic goes here
});
});
return Base.action.Press(adapter);
}
我看不到任何类似'Bill'或'Bill All'的Base.Actions .
这显然不是我需要的代码,但我认为这是一般的起点 .
在审查了源业务逻辑之后,我没有看到任何“Bill”或“Bill All”操作 - 或任何“操作”(令人费解) . 我看到一个名为'items'的IEnumerable方法,所以这就是我上面开始的 .
这是正确的方法吗?
更新:2017年2月14日
使用提供的答案re:重写的方法InsertTransaction(...)我试图使用以下逻辑设置我们的ARTran用户字段(这是必需的):
PMProject pmproj = PXSelect<PMProject, Where<PMProject.contractID, Equal<Required<PMProject.contractID>>>>.Select(Base, tran.ProjectID);
if (pmproj == null) return;
PMProjectExt pmprojext = PXCache<PMProject>.GetExtension<PMProjectExt>(pmproj);
if (pmprojext == null) return;
ARTranExt tranext = PXCache<ARTran>.GetExtension<ARTranExt>(tran);
if (tranext == null) return;
tranext.UsrContractID = pmprojext.UsrContractID;
即使这会将用户字段设置为正确的值,但仍会在进程完成时向我提供必填字段为空的错误 . 我有限的知识使我无法理解为什么 .
1 回答
在“运行项目开票”屏幕上, Process 和 Process All 按钮的 Headers 在BLC构造函数中分别更改为 Bill 和 Bill All . 在BillingFilter_RowSelected处理程序中为 Items 数据视图设置了进程委托:
如上面的代码片段所示, AR Invoice and Memos 屏幕中的所有记录都是由PMBillEngine类的实例创建的 . 以下是显示如何在PMBillEngine BLC扩展中覆盖
InsertNewInvoiceDocument
和InsertTransaction
方法的代码段:Run Project Billing 进程调用
InsertNewInvoiceDocument
方法在 AR Invoice and Memos 屏幕上创建新记录,并使用InsertTransaction
方法添加新发票交易 .当用户从处理 Run Project Billing 屏幕或数据条目 Projects 屏幕启动“运行项目开票”操作时,将调用 One important thing to mention: 重写
InsertNewInvoiceDocument
和InsertTransaction
方法 .有关如何覆盖虚拟BLC方法的更多信息,请参阅每个Acumatica ERP 6.1网站中的 Help - > Customization - > Customizing Business Logic - > Graph - > To Override a Virtual Method