嘗試這樣的事情(我copypasted從問題How to Customize screen Release AP Documents (AP501000) in Acumatica代碼,並修改了它):
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);
}
}
}
是的,這應該是我想。 – xxxAcuGeekxxx
你有任何參考代碼? – HariEko
[如何在Acumatica中自定義屏幕發佈AP文檔(AP501000)]的可能副本(http://stackoverflow.com/questions/36689720/how-to-customize-screen-release-ap-documents-ap501000-in-acumatica ) – Gabriel