I know that in 15 minutes after posting this, I will find my stupid mistake.
Until then, I get the following error when publishing my project:
Method System.Collections.Generic.List`1[PX.Objects.AP.APRegister] ReleaseInvoice(PX.Objects.GL.JournalEntry, PX.Objects.AP.APRegister ByRef, PX.Data.PXResult`4[PX.Objects.AP.APInvoice,PX.Objects.CM.CurrencyInfo,PX.Objects.CS.Terms,PX.Objects.AP.Vendor], Boolean, System.Collections.Generic.List`1[PX.Objects.IN.INRegister] ByRef, ReleaseInvoiceDelegate) in graph extension is marked as [PXOverride], but the original method with such name has not been found in PXGraph
This is the delegate I am using to override the ReleaseInvoice method. It looks to me like it is within the APDocumentRelease Graph. Any ideas why it is not publishing? This code compiles with no reference errors at all. The signature of my delegate looks spotless. :-)
namespace PX.Objects.AP
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class APDocumentRelease_Extension : PXGraphExtension<APDocumentRelease>
{
public delegate List<APRegister> ReleaseInvoiceDelegate(JournalEntry je, ref APRegister doc, PXResult<APInvoice, CurrencyInfo, Terms, Vendor> res, bool isPrebooking, out List<INRegister> inDocs);
[PXOverride]
public virtual List<APRegister> ReleaseInvoice(JournalEntry je, ref APRegister doc, PXResult<APInvoice, CurrencyInfo, Terms, Vendor> res, bool isPrebooking, out List<INRegister> inDocs, ReleaseInvoiceDelegate baseMethod)
{
//call the base method
var result = baseMethod(je, ref doc, res, isPrebooking, out inDocs);
//this is how I determined which method to override
//APInvoiceEntry (graph)
// Release action
// signature public override IEnumerable Release(PXAdapter adapter)
//
// PXLongOperation.StartOperation(this, delegate() { APDocumentRelease.ReleaseDoc(list, false); });
//
// This method is in the APDocumentRelease GRAPH
// APDocumentRelease.ReleaseDoc
// signature public static void ReleaseDoc(List<APRegister> list, bool isMassProcess, bool isPrebooking, List<Batch> externalPostList)
//
// ReleaseDocProc
// signature public virtual List<APRegister> ReleaseDocProc(JournalEntry je, APRegister doc, bool isPrebooking, out List<INRegister> inDocs)
//
// THIS IS THE ONE I AM USING AS THE DELEGATE
// ReleaseInvoice(je, ref doc, res, isPrebooking, out inDocs);
// signature public virtual List<APRegister> ReleaseInvoice(JournalEntry je, ref APRegister doc, PXResult< APInvoice, CurrencyInfo, Terms, Vendor > res, bool isPrebooking, out List<INRegister> inDocs)
//
// this.Actions.PressSave();
//THIS IS WHERE I WILL DO MY STUFF
//for each AP document, check if there is a value in the UsrProjectID field (UDF) of the APRegister table
//If there is, update the UsrProjectID (UDF) field in the Batch table
APRegisterExt itemAPExt = PXCache<APRegister>.GetExtension<APRegisterExt>(doc);
Batch batch = SelectFrom<Batch>.
Where<Batch.batchNbr.IsEqual<@P.AsString>>.
View.Select(Base, doc.BatchNbr);
BatchExt itemBatchExt = PXCache<Batch>.GetExtension<BatchExt>(batch);
itemBatchExt.UsrProjectID = itemAPExt.UsrProjectID;
return result;
}