在Acumatica中,可以通过使用事件处理程序覆盖Release方法并确保先执行基础操作来解决此问题。以下是实现此目的的代码示例:
public class MyReleaseProcess : PXGraphExtension, IInvoiceRelease
{
public delegate List ReleaseDocProcDel(JournalEntry je, ARInvoice ardoc, List pmDocs, List iCRTrans, List aRTrans);
[PXOverride]
public List ReleaseDocProc(JournalEntry je, ARInvoice ardoc, List pmDocs, List iCRTrans, List aRTrans, ReleaseDocProcDel del)
{
// Call the base ReleaseDocProc method first
List result = del(je, ardoc, pmDocs, iCRTrans, aRTrans);
// Perform the base operation here before the custom logic
Base.MyBaseMethod();
// Perform the custom logic here
return result;
}
}
需要注意的是,在此示例中使用的是AR Invoice Release文档类型,但您可以根据需要将其更改为其他文档类型。