本文介绍了在Acumatica系统中自定义发布AP文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Acumatica中的BLC有疑问。
我们知道,使用ARInvoiceEntry BLC的屏幕Invoices And Memos(AR301000)中的释放过程会调用ARDocumentRelease静态方法ReleaseDoc。
和ReleaseDoc调用虚拟的ReleaseDocProc方法,该方法会创建GLTran记录。

I have a question about the BLC in Acumatica.As we know release process in screen Invoices And Memos (AR301000) using ARInvoiceEntry BLC that is invokes ARDocumentRelease static method ReleaseDoc.And ReleaseDoc invokes virtual ReleaseDocProc method, which creates GLTran Records.

我的问题:APInvoiceEntry BLC中是否也引入了此条件,该API调用了APDocumentRelease静态方法ReleaseDoc。并且ReleaseDoc还会调用虚拟ReleaseDocProc方法吗?

My question : did this condition also imlemented in APInvoiceEntry BLC that invoikes APDocumentRelease static method ReleaseDoc. And ReleaseDoc invokes virtual ReleaseDocProc method also ?

因为我在屏幕Invoice和Memos中有一个附加字段,并且希望在释放按钮时将该附加字段中的值发送给Journal Transaction在点击。即使从发票和备忘屏幕以及从 AR发行流程屏幕也可以发行。我已经完成了此自定义操作。

because I have a additional field in screen Invoice And Memos and want to sent the value in this additional field to Journal Transaction when button release is clicking. Eventhough release from screen Invoice And Memos and also from AR Release Process screen. And I have finished with this customization.

现在,我需要对屏幕AP Release Process屏幕执行相同的操作。

Now I need to do the same thing for screen AP Release Process screen.

任何建议如何提供?

推荐答案

尝试类似的方法(我从问题和

Try something like this(I copypasted code from question How to Customize screen Release AP Documents (AP501000) in Acumatica and modified it):

using System;
using System.Collections.Generic;
using PX.Data;
using PX.Objects.AP;
using PX.Objects.GL;
using PX.Objects.CM;
using PX.Objects.CS;
using PX.Objects.IN;

namespace SGLCustomizeProject
{

    public class ARRelaseProcessExtension : PXGraphExtension<APReleaseProcess>
    {
        public delegate List<APRegister> ReleaseDocProcDel(JournalEntry je, ref APRegister doc, PXResult<APInvoice, CurrencyInfo, Terms, Vendor> res, bool isPrebooking, out List<INRegister> inDocs);
        [PXOverride]
        public virtual List<APRegister> ReleaseDocProc(JournalEntry je, ref APRegister doc, PXResult<APInvoice, CurrencyInfo, Terms, Vendor> res, bool isPrebooking, out List<INRegister> inDocs, ReleaseDocProcDel del)
        {
            je.RowInserting.AddHandler<GLTran>((sender, e) =>
            {
                GLTran glTran = e.Row as GLTran;

                APInvoice api = PXSelect<APInvoice, Where<APInvoice.refNbr, Equal<Required<GLTran.refNbr>>, And<APInvoice.docType, Equal<Required<GLTran.tranType>>>>>.Select(sender.Graph, glTran.RefNbr, glTran.TranType);
                if (api != null && api.InvoiceNbr != null)
                {
                    GLTranExtension glTex = PXCache<GLTran>.GetExtension<GLTranExtension>(glTran);
                    glTex.UsrInvoiceNbr = api.InvoiceNbr;
                }
            });
            return del(je, ref doc, res, isPrebooking, out inDocs);
        }
    }
}

这篇关于在Acumatica系统中自定义发布AP文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 09:12