Customize Release AP Document in Acumatica System

假如想象 提交于 2019-12-12 03:28:43

问题


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.

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

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.

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

any suggestion how to provide it ?


回答1:


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


来源:https://stackoverflow.com/questions/36784480/customize-release-ap-document-in-acumatica-system

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!